user179115
user179115

Reputation: 25

Jquery works in Firefox, Safari & Opera but not IE?

This is weird. I am testing to see if JQuery is installed by adding an alert.

This works fine in Firefox, safari, opera and chrome, but IE 6/7 simply do not show the alert. JavaScript is enabled. Has anybody ever come accross this?

$(document).ready(function()
{ 
   alert('Test');
});

Upvotes: 0

Views: 1133

Answers (5)

Daren Schwenke
Daren Schwenke

Reputation: 5478

You have trailing comma's in your n-america and c-america definitions. This will break in IE6 and work fine pretty much everywhere else. Arrays have to end with no trailing comma in IE6.

EDIT: Beat me by 6 seconds. :)

Upvotes: 0

Ben
Ben

Reputation: 46

You have unnecessary comas in your javascript in several places in your inline object declarations.

$('a#n-america').qtip({
              content: 'Nouth America',
              show: 'mouseover',
              hide: 'mouseout',
              style: { name: 'cream' },  // <<<<< LIKE HERE
        })

Firefox is tolerant of that. But IE will simply refuse to run that entire javascript code section.

Technically IE is right, it's badly constructed javascript..

Ben

Upvotes: 3

Kip
Kip

Reputation: 109407

Is the file you are testing on your local hard drive or on the internet somewhere? Internet Explorer doesn't execute Javascript on local html files, unless you click "Allow blocked content" on the yellow bar that pops up.

Upvotes: 0

Shaun
Shaun

Reputation: 4167

Can you post the rest of your HTML here? It may be because the HTML that you're creating is not becoming "ready" (lack of ending tags, etc)

Upvotes: 1

CodeJoust
CodeJoust

Reputation: 3790

Are you including the jQuery script? Do you have a valid doctype? Furthermore, are your script tags properly noted ( not ). Try using the IE error console (in the tools menu), which might provide a reason why the javascript isn't working. It looks like a problem with the format of you html. Different browsers parse bad or incorrect html in different ways. IE 6-7-8 do work with jQuery, so it doesn't have to do with jquery.

Upvotes: 0

Related Questions