Jump to content

simple code, but something is missing


YigalB

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.