IE9 throws exceptions when loading scripts in iframe. Why?

后端 未结 6 1333
失恋的感觉
失恋的感觉 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:47

    There is this msdn page about this bug (or feature).

    You get these kinds of errors when you move the iframe element around in DOM. In such cases, IE 9 garbage collects the iframe (causing your undefined bug) and reloads it at another position.

    In general, you should create the element, set its src attribute only once and then put it somewhere in the DOM tree once. It has nothing to do with the code which runs in the iframe itself.

提交回复
热议问题