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.
精彩评论