Reputation:
Can some of you please tell me why a simple alert()
isn't working using jQuery 1.4 in Internet Explorer 7, when it's working in all other browsers? It's been driving me crazy now for the last half an hour..!
$(document).ready(function(){
alert("wtf?");
})
This simple example doesn't show an alert in IE7. See for yourself at http://jsfiddle.net/8HQdp/.
Upvotes: 4
Views: 15955
Reputation: 28144
window.alert()
- it's possible (though improbable) that another alert()
is conflicting with window
's.If you have console support, try console.log(alert);
and see what it says. It should be something like:
function alert() {
[native code]
}
Upvotes: 4
Reputation: 2830
It works in IE 7 mode in IE 8 form me. Takes a while but it does trigger.
I noticed that there is a semi colon missing from the ready function. should be...
$(document).ready(function(){
}); //missing semicolon here
Also, try using the shortcut for the DOM ready function...
$(function(){
// code here
});
Upvotes: 0
Reputation: 3721
I'm using IE8 but with IE7 mode, the alert on http://jsfiddle.net/8HQdp/ still triggers. Try changing $ to jQuery and host your own jquery.js.
And also try console.log('wtf') before alert so u know whether it's alert or document.ready is broken.
Upvotes: 2