YigalB Posted February 3, 2012 Share Posted February 3, 2012 While trying to run very simple code of javascript from within PHP, it runs when the code is: <h2>My header</h2> <script language = 'javascript'>; alert('here I am'); </script> <?php echo "starting Now <BR>"; But when the code is: <h2>My header</h2> <script language = 'javascript'>; document.write(“xxxx”); alert('here I am'); </script> <?php echo "starting Now <BR>"; It fails to run the js code, and also the alert is not executed. The only thing I added was document.write(“xxxx”); What did I miss? Link to comment https://forums.phpfreaks.com/topic/256341-simple-code-but-something-is-missing/ Share on other sites More sharing options...
YigalB Posted February 3, 2012 Author Share Posted February 3, 2012 problem solved. Wrong quotation marks were used. Link to comment https://forums.phpfreaks.com/topic/256341-simple-code-but-something-is-missing/#findComment-1314127 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.