2010-06-14, 01:43 PM
when including this javascript in headerinclude:
I get a PHP error: Parse error: syntax error, unexpected '(', expecting T_VARIABLE or '$' in /home/studio/public_html/global.php(436) : eval()'d code on line 23
This is a working JQuery Javascript. How can it cause a PHP error??
edit: never mind. Obviously it's because it tries to parse the {$ as if it was a variable. Inserting a space fixes the problem.
function CloseAlert()
{walert=document.getElementById('walert');$(walert).fadeTo('slow',0.0,function(){$(walert).remove();});}
I get a PHP error: Parse error: syntax error, unexpected '(', expecting T_VARIABLE or '$' in /home/studio/public_html/global.php(436) : eval()'d code on line 23
This is a working JQuery Javascript. How can it cause a PHP error??
edit: never mind. Obviously it's because it tries to parse the {$ as if it was a variable. Inserting a space fixes the problem.