Question about jQuery source == on window

前端 未结 1 1749
[愿得一人]
[愿得一人] 2021-01-20 14:53
data: function( elem, name, data ) {
    if ( !jQuery.acceptData( elem ) ) {
        return;
    }
    elem = elem == window ? windowData : elem;

C

相关标签:
1条回答
  • 2021-01-20 15:45

    See here for why checking againts the window object with === is unsafe in IE.

    I think the root cause is that IE is closely coupled with the Windows OS so you have various OS objects referenced through window and the equality check just dies. That and it just doesn't handled the global host object correctly.

    0 讨论(0)
提交回复
热议问题