Javascript Causes Internet Explorer cannot open the Internet site

13 02 2009

A nightmare situation… Your page works fine in most browsers, you test it in Internet Explorer 7 and just as it looks like everything is working fine you get this:

Internet Explorer cannot open the Internet site

Internet Explorer cannot open the Internet site

Bam! Right in the kisser!

I narrowed down the problem down to this:

<script type=”text/javascript”>
jQuery(‘#Calendar1 *’).tooltip();
</script>

Which is a jQuery plugin for adding tooltips. Its very good, but it looked like IE doesn’t like it!

Don’t despair though, it is just that IE does not like being rushed, adding an event handler to make the function wait until the entire page is ready fixes the problem

<script type=”text/javascript”>
jQuery(document).ready(function () {
jQuery(‘#Calendar1 *’).tooltip();
});
</script>

Moral of the story, don’t rush IE! and keep your javascript unobtrusive!


Actions

Information

Leave a comment