jquery, XHTML 1.1 Strict, and NS_ERROR_INVALID_POINTER

December 13th, 2008 at 23:20

I ran into a tiny poorly-documented problem with Firefox and jquery.

I’m developing a website using XHTML 1.1 Strict. This causes firefox to barf with a semi-helpful parsing error when the page it loads is not valid XML, instead of the usual behaviour which is to guess at what the developer meant and make and display a DOM tree anyway. This can be nice to help you validate as you code.

What it doesn’t handle well is when the changes you make to the DOM tree are not valid. I’m also using jquery in my page, and if you screw up your XML, you’ll get an almost useless error in your javascript console:

uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]“  nsresult: “0×80004003 (NS_ERROR_INVALID_POINTER)”  location: “JS frame :: http://yourserver/include/jquery.js :: anonymous :: line 11″  data: no]

Line 0

So, viewers who are hopefully finding this page via google: if you are getting this error when modifying the DOM tree with jquery, and you’re using XHTML 1.1 Strict, then you’ve probably screwed up your XML.

Comments (1)

1 Comment »

  1. Got the same error right know, so i checked my XML, and that looked pretty good.
    Found out that the doctype rule messed up here…
    removed it, and all works find now…

    Comment by Noel — June 8, 2009 @ 4:32 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment