📜  如何在 php 代码示例中编写 javascript

📅  最后修改于: 2022-03-11 14:54:33.545000             🧑  作者: Mango

代码示例2
//this is my code 

you can add javascript to your code by using the echo statement and rap all 
your javascript between "" and if there is "" in the javascript code
then add \ before any "", and for the php inside rap it with ''
  
  
document.write(\"hello world\")"
?>
  
//other example

document.write('$a')"
?>

//other example
  

             localStorage.setItem(\"id\", '$TokenData->id');
             localStorage.setItem(\"name\", '$TokenData->name');
             localStorage.setItem(\"email\", '$TokenData->email');
       ";