Skip to content


jQuery vs. IE7

Just a note to all those that may stumble about the same issue with Internet Explorer 7 and JavaScript (and maybe jQuery). The following code works fine in Firefox and Safari:

$(document).ready(function(){
  $(".showtooltip").qtip({
    content: {
      text: false,
    }
  });
});

Then I tried the website with IE7 and it just didn’t work. Got some error message indicating an error on a certain line – but no real  help to find the bug. So I asked Google and it found a blog post about issues with jQuery and IE7. The solution is as simple as removing the trailing comma after the last entry of an array. The corrected code looks like:

$(document).ready(function(){
  $(".showtooltip").qtip({
    content: {
      text: false
    }
  });
});

There was just that comma after “text: false,” – and oh wonder, now it works also in IE7. Damned stupid browser. BTW: The above is for using qTip, a jQuery library to show tooltips which is pretty nice.

Posted in Web Development.

Tagged with , , , , , .


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Michael says

    This is true for every other js framework as well as for js itself. IE doesn’t know how to deal with an object if the last element has a comma in the end

Continuing the Discussion

  1. jQuery not working in IE7 | Renegade Empire linked to this post on 2011/09/01

    [...] the solution was simple for me and I found that solution after much search, on this website http://blog.rimann.org/2009/08/jquery-vs-ie7/. It turned out that all that needed to happen as to remove an extra comma from my jQuery code. [...]



Some HTML is OK

or, reply to this post via trackback.