jquery - iframe access denied in IE on some pages

前端 未结 5 1444
深忆病人
深忆病人 2020-12-05 15:36

I\'m the author of printThis, a jquery plugin for printing.

https://github.com/jasonday/printThis

I have a user that has brought up an issue, that I have bee

5条回答
  •  自闭症患者
    2020-12-05 16:22

    As long as you set iframe src, the same origin has to be verified against parent element, even if you set it as 'about:blank'. I guess IE fails in proper checkng, or some javascript ran and set the document.location to different one than the iframe is created.

    How about NOT setting src at all like the following? it still should work.

    var $iframe = $("