开发者

jQuery script not functioning in IE9 or Chrome (works in FireFox)

开发者 https://www.devze.com 2023-03-22 07:32 出处:网络
Attempting to get jQuery to execute a method upon loading a page fails for Chrome and IE9. The following attempts to execute a method have been tried to no avail:

Attempting to get jQuery to execute a method upon loading a page fails for Chrome and IE9. The following attempts to execute a method have been tried to no avail:

(function($) { $(document).ready(function(){
slideShow(7500); }); })(jQuery);

$(document).bind("ready", function() { slideShow(7500); })

$(windo开发者_如何学Gow).load(function() {slideShow(7500);});
alert(typeof $);

Please note: the last of these attempts to execute jQuery failed to even produce an alert in Chrome and IE9.

Also, placing these scripts at the end of the document did not solve the problem. Doing so produced a blank page. All versions of the script listed above work in FireFox.


Have you tried just

$(document).ready(function(){
    slideShow(7500); 
}

after you include jquery?


(function($) { $(document).ready(function(){
slideShow(7500); }); })(jQuery);

seems a bit convoluted (as jessica points out) but should still work. I suspect your slideShow() function is the cuplrit.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号