Error in Internet Explorer 9 (not earlier versions or other browsers) when including jQuery in an iframe

前端 未结 4 1662
灰色年华
灰色年华 2021-01-11 18:46

Basically I have a page that launched a fancybox iframe. In that iframe I also include jQuery. But when I testing it in Internet Explorer 9 it gives me the error <

4条回答
  •  清酒与你
    2021-01-11 19:19

    D'oh, thought I had the latest fancy box. Turns out I had 1.3.1, 1.3.4 fixes this issue.

    UPD(sompylasar): In fact, that was fixed in 1.3.2 (see the changelog). I've compared the source code of 1.3.2 with 1.3.1 and found the following difference which solves the issue:

    content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
    

    where isIE6 evaluates to:

    isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
    

    This snippet should be executed before removing the iframe from the DOM.

提交回复
热议问题