responseXML.documentElement is null or not an object

Ok I have yet another reason to loath IE7. I had an error on Whats-hot-weekly.com earlier in regard to this error message on my ajax XML object:
responsexml.documentElement is null or not an object
Everything worked in Firefox, Chrome, and even my Nokia N810’s browser, but IE7 just wasn’t going to cooperate. I knew that it was working last night, but I made a few changes before going to bed.

Two of the changes I made was in relation to the meta tags in the HTML of the main index page. I added keywords and description for search engine optimization. Little did I know that one of these was the culprit.

After much Googling, I came upon this article. In it I immediately found the reason for the error. It should have been a little obvious but I had overlooked something simple. My search box for entering in keywords had an id(and name) of “keywords”. The new meta tag for keywords also used the “name=keywords” attribute.

In the article, it was the “description” meta tag that had caused the conflict. Upon evaluating that, I realized my mistake. This effected IE only because IE checks the name attribute when you call document.getElementById. It was grabbing the meta element instead of the search box.

I hope this helps someone else, in the event that all the variables fall into place for this to happen again.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.