(This is ticket 6162 which I spammed here after a question on the IRC channel.)
Since jQuery 1.4, my XHTML web-app (too vague, I know) throws a fatal error in the |CLASS| function. Apparently, the |elem| that is being used is not an element but a |DocumentFragment|.
When I switch the |Content-Type| to |text/html|, the problem is gone.
I have hackily patched the |CLASS| function in jquery-1.4.2.js on line 3269 to check for a |firstChild| as follows:
if (elem.getAttribute) {
className = elem.getAttribute('class');
} else if (elem.firstChild && elem.firstChild.getAttribute) {
className = elem.firstChild.getAttribute('class');
}
} return (" " + className + " ").indexOf( match ) > -1;