IE9 throws exceptions when loading scripts in iframe. Why?

后端 未结 6 1341
失恋的感觉
失恋的感觉 2020-12-15 03:58

Precondition:

I have an aspx-page with iframe inside. This iframe points to the url handled by MVC on the same site (it\'s hybrid site, both standard ASP.NET and ASP

6条回答
  •  攒了一身酷
    2020-12-15 04:31

    I have encountered this same situation in the wild. Basic symptoms:

    • You load script code in an iframe
    • The script code runs early (from the head section or top of body)
    • IE complains about some missing native object

    I found that it can often be prevented by delaying the execution of the script code until onload or DOMContentLoaded... Not much help I know but this is one of the most difficult IE scripting bugs I have ever encountered. I upped the score of your question, hope it will be found by others as well and we can get a more detailed answer.

    Also see this question: Error in Internet Explorer 9 (not earlier versions or other browsers) when including jQuery in an iframe

提交回复
热议问题