missing } in XML expression error in javascript

lilyyan used Ask the Experts™

i consistently got an error in a simple js file :  missing } in XML expression

the js is:
function turnoff()

from firefox, the error is:  missing } in XML expression.

is there anything wrong in the above code?

Thanks so much for your help!
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
looks fine to me, but its a function, not a XML expression...
Firefox would seem to be misinterpreting part of your code.  However I don't see an issue in the snippet you shared.  If you do have a simple example then post the complete page.  In some cases the line reported for the error is not really the cause.

Expert of the Year 2008
Top Expert 2008
The code you posted is not the problem. Check around the point where you are calling the function. If you are getting data via AJAX and using eval, make sure the data you are getting is "proper" javascript code. Meaning, look for missing/mismatched '}'


hi, thanks for all replies. i just simply commented out the js file and the error is gone...
I wish I could comment out all my problems

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial