Reputation: 157
One of my javascript files is returning an error log on the following line
if(strinput.indexOf('<?')>-1||strinput.indexOf('!xml')>-1||strinput.indexOf('xml')>-1)
and the error is
[20-Apr-2012 14:06:32] PHP Parse error: syntax error, unexpected '!'
in /home6/mywebsite/public_html/phpspellcheck/include.js on line 295
but if I remove the ! the error changes to
[20-Apr-2012 14:15:40] PHP Parse error: syntax error, unexpected T_STRING in
/home6/mywebsite/public_html/phpspellcheck/include.js on line 295
Any help would be very appreciated. Thanks in advance.
Upvotes: 0
Views: 90
Reputation: 63442
That's because the server is interpreting the files as PHP (and that is invalid PHP syntax) instead of sending them as they are to the client to be interpreted as JavaScript.
Upvotes: 2