Possible Duplicate:
Reference – What does this error mean in PHP?
I keep on getting a “Parse error: syntax error, unexpected ‘(‘, expecting T_VARIABLE or ‘$’ in…”
Here’s the line thats causing the problem, not sure whats going on here?
$text = "<script>window.setInterval(function(){$('#liveData').load('liveUpdate.php');}, 1000);</script>";
Thanks in advance
You should escape
$in your$textOr you just use single quote.
Because
$in double quote will be followed by a php variable name,$(XXXXis an invalid PHP variable.So the best way is to separate javascript (jquery) into a .js file.