Home  >  Article  >  Backend Development  >  Dynamically generate JavaScript code in php_PHP tutorial

Dynamically generate JavaScript code in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:47:151039browse

Copy code The code is as follows:

echo <<
JS;
?>




Please Click

< ;/html>

Copy code The code is as follows:

$ confirm = "Are you OK with this?"; //Define the message on the confirmation box
$ok_msg = "I'm OK!"; //The message when OK
$not_ok_msg = "I'm not OK!"; //Cancel information

echo ""; //End of output
?>

< ;head>


Please Click


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319951.htmlTechArticleCopy the code as follows: ?php echo JS //Use multi-line output method to output JavaScript code SCRIPT Language = " JavaScript" function func() { if(confirm("Are you OK with this?")) {...