echo a javascript with xmlhttp.open in it...
Ok this is the code:
Code:
echo '<script type="text/javascript">
<!--
var updateTimeout;
more code, more code, more code
xmlHttp.open('GET', 'xml.php?xpos='+xPos+'&ypos='+yPos+'&random='+Math.random(), false);
xmlHttp.send(null);
more code, more code, more code
// -->
</script>';
Well shortened the code a bit but the bold line gives this error:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /../test/page1.php on line 62
The problem is in the ' tag, how can I fix this? Tried many options using " and '" but nothing worked...
Thx