views:

230

answers:

5

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');
});

UPDATE: Link here to code: http://tinyurl.com/yjmwj92

A: 

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.

CodeJoust
+1  A: 

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)

Shaun F
Added link at the top, thanks
A: 

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.

Kip
Added link at the top, thanks
+2  A: 

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

Ben
Much appreciated Ben!
weird, it's perfectly valid Java. good find
Kip
no probs. i've done this mistake so many times.. the annoying thing is IE doesn't throw any error or notification, just drops it entirely..
Ben
A: 

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. :)

Daren Schwenke