Internet Explorer reserved word problem

Added on: Wednesday 25th February 2009

I was working on an update to some software the other day and while it worked fine in Firefox and Opera it kept throwing up a javascript error in Internet Explorer.

I am always hopeful that one day there will be a time that you can create a web application knowing that it will look and operate exactly the same across all browsers without the need for extensive testing in each one.

Unfortunately this won't happen soon so for the time being we are stuck with applying fixes for the various shortcomings and vagaries of modern browsers.

To cut a long story short, when I finally tracked down the error it had nothing to do with javascript at all.

The problem appears to be that I had an element on the page that I had given an id of 'tags' (because I was updating the tags field for a record via AJAX).

Simply changing the id of this element to something other than 'tags' solved the problem, so it seems that this is probably a reserved word for IE.

It was only afterwards that I did a search on Google (probably because I didn't know what I was looking for initially) and found some references to javascript print errors to do with an id of 'tags'. 

comments powered by Disqus