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? Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.