Friday, September 21, 2012

Browser compatibility

I am a bit surprised that now browsers are around for so long, that we still see incompatibilities w.r.t. JavaScript and HTML/DOM. I had some code that worked fine for IE and Chrome. Turns out Firefox did not work. Here is the reason: http://stackoverflow.com/questions/1359469/innertext-works-in-ie-but-not-in-firefox.

I used the fix from http://blog.coderlab.us/2006/04/18/the-textcontent-and-innertext-properties/.