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/.

4 comments:

  1. I attribute this mainly to certain companies (- cough - Microsoft - cough) seeking to create their own "standards".

    ReplyDelete
  2. In a lot of ways we aren't much better off than we were when the web started in terms of technology. Most of the recent client side innovations (CoffeeScript, jQuery, etc.) are nothing more than JavaScript in another form.

    ReplyDelete
    Replies
    1. Case in point: If web technologies weren't broken, it might be possible for me to get the "'" out of my name. I've been trying for years now. :)

      Delete
    2. Ugh. The "" above actually contained "& # 3 9 ;" without the spaces. Blogger stripped it out for security.

      See what the apostrophe-challenged among us deal with on a daily basis?

      Delete