views:

438

answers:

1

I am trying to upgrade an existing application from jQuery 1.3.2 to jQuery 1.4.2. When I do this, the page fails to load correctly and firefox's error console displays the error message "uncaught exception: Syntax error, unrecognized expression: Syntax error, unrecognized expression: search".

How can I determine what is causing this exception?

A: 

Set Firebug to break on all script errors, by clicking the icon on the top-left corner of the Console tab.
Next time the error happens, you'll be taken to the relevant line. (You'll need to go up the call stack first, though)

Alternatively, search your script for the word search inside a selector.

SLaks
Firebug gave me this: `uncaught exception: Syntax error, unrecognized expression: Syntax error, unrecognized expression: search ? in ScriptResource.axd?d=***(Object { name="a"})Script...3ca6096 (line 5) ScriptResource.axd?d=***()Script...157a49c (line 499) [Break on this error] Function.__typeName="Function";Functio...ass("Sys.UI.Control",Sys.Component);Script...3ca6096 (line 5)`but I don't really know if that's useful at all, and I don't know what you meant by "go up the call stack first". I don't see any selectors called search, the closest is one called ProductSearch.
wham12
In the Script tab while debugging, there should be a list of function calls.
SLaks
Okay, I think I've finally narrowed it down to something that does `$("#Selector").watermark()` as the issue...time to go home and do more debugging next week.
wham12
Yup, that was it. The watermark plug-in had a compatibility issue between the version we were using and JQuery 1.4. Upgrading to a newer version of the plugin fixed the problem.
wham12