Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

iframe causes IE9 javascript errors because of DOM manipulation in jqm init function #3617

Closed
msoliver opened this Issue Feb 21, 2012 · 2 comments

Comments

Projects
None yet
3 participants

Scenario: HTML containing iframe, but no jqm "page" causes script errors while loading the iframe source when using IE9

Details:

The root cause of this issue is explained here:
http://msdn.microsoft.com/en-us/library/gg622929%28v=VS.85%29.aspx?ppud=4

In short, the jquery mobile init script can, conditionally, move the iframe element in the DOM, triggering the above issue in IE9. Scripts loaded in the contained iframe will then encounter errors like 'Object' is not defined, 'Array' is not defined, etc.

The line of code that causes the DOM manipulation is in initializePage():

$pages = $( "body" ).wrapInner( "..." ).children( 0 );

This line of code is triggered when there isn't a jsm "page" in the HTML.

There are many alternatives to add the pseudo jsm "page" into the DOM rather than using wrapInner. This is a non-typical scenario but still valid, I think - and was a bit of a pain to debug! - so documenting at the very least.

Contributor

toddparker commented Feb 22, 2012

Thanks for the detailed report.

Owner

arschmitz commented Aug 7, 2013

this appears to be fixed in latest checking http://jsbin.com/ofuhaw/1/edit in ie9 it renders properly in the iframe with no errors

@arschmitz arschmitz closed this Aug 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment