jQuery .load方法没有在IE9上触发 [英] jQuery .load method not firing on IE9

查看:89
本文介绍了jQuery .load方法没有在IE9上触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有4个div(class = mydiv),每个都有一个图像,load方法在我测试的所有其他浏览器上触发,但它不会在IE9.0上触发。我不知道它是否适用于任何其他IE浏览器。

I have 4 divs (class=mydiv), each with an image in, the load method fires on all other browsers I've tested but it does not fire on IE9.0. I don't know if it works in any other IE.

$.noConflict();

jQuery(document).ready(function(){

    jQuery('.mydiv img').load(function(){

        alert("fired");

    });

});

尝试使用这些jQuery版本:

Tried using these jQuery versions:

1.4.2

1.5.2

1.6.2

1.5.1rc1

1.4.2
1.5.2
1.6.2
1.5.1rc1

推荐答案

我遇到了同样的问题并解决了使用:

I had the same problem and solved using:

if ($.browser.msie && parseInt($.browser.version) < 10) {
    window.onload = new function() {
        console.log('LOADED IE');
    }
} else {
    $(window).load(function(){
        console.log('LOADED');
    })
}

这篇关于jQuery .load方法没有在IE9上触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆