开发者

Jquery upgrade from 1.3.1 to 1.5.1 throwing error at removeAttr on IE7

开发者 https://www.devze.com 2023-03-11 08:41 出处:网络
I have the following code and in IE7 alone the browser crashes , this is some legacy code. Finally i tried various debugging by making alert statements and found that problem is at line $(this).remove

I have the following code and in IE7 alone the browser crashes , this is some legacy code. Finally i tried various debugging by making alert statements and found that problem is at line $(this).removeAttr('myCustomattr');

I want to know why this is started breaking after i upgrade from jquery1.3.1 to jquery1.5.1 The remove attr is working fine in all other browsers except IE7.

May i know wha开发者_如何学JAVAt is real issue with this removeAttr with latest jquery.

If i switch to jquery1.3.1 , it started working again.

removeAttr is throwing error , if i comment that it works

  $('#myImgagesDiv img').each(function () {
    if ($(this).attr('myCustomattr')) {
        $(this).attr('src', $(this).attr('myCustomattr'));
        $(this).removeAttr('myCustomattr'); // code creating problem
    };
});
0

精彩评论

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

关注公众号