Khan / khan-mobile

You’re probably looking for www.github.com/khan/mobile
237 stars 34 forks source link

4 x "SYNTAX_ERR: DOM Exception 12" #56

Closed sophiebits closed 13 years ago

sophiebits commented 13 years ago

Getting SYNTAX_ERR: DOM Exception 12 four times every time I start the app.

John's blog suggests that this is a querySelectorAll error. Somehow it doesn't like a selector being used?

http://ejohn.org/blog/thoughts-on-queryselectorall/

I tried to debug this but wasn't very successful without a proper debugger (can't make it happen in desktop Safari). It looks like one of the failures is on div[data-id="main"] > div[data-role="page"]:first but then I can't make the same error when querying that later in the code.

sophiebits commented 13 years ago

The first one to appear is from these lines in jQuery:

try {
    // This should fail with an exception
    // Gecko does not error, returns false instead
    matches.call( document.documentElement, "[test!='']:sizzle" );

} catch( pseudoError ) {
    pseudoWorks = true;
}

I thus conclude that webView:exceptionWasRaised:sourceId:line:forWebFrame: is called for even caught exceptions and so this is (hopefully) not a problem when using the normal UIWebView. Closing.

(The other three errors disappear as well if querySelectorAll is disabled in jQuery, but it's probably the same thing.)

adamjernst commented 13 years ago

Your conclusion is correct.