JavaScript code";"."/> JavaScript code";".">
Home >Backend Development >PHP Problem >What is the method for php to call js?
Recommended: "PHP Video Tutorial"
PHP calls JS
Value: Display: values;
<html> <body> <script type="text/javascript"> var str = 'values'; </script> <?php echo "<script type=text/javascript>document.write(str)</script>"; ?> </body> </html>
Call function (method) Pop-up window: 9
<html> <body> <script type="text/javascript"> function add(){ var x = 0; x = x + 9; alert(x); } </script> <?php echo "<script type=text/javascript>add()</script>"; ?> </body> </html>
Related recommendations: php training
The above is the detailed content of What is the method for php to call js?. For more information, please follow other related articles on the PHP Chinese website!