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!

Advertisement

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.