PDA

View Full Version : Need to redirect an IFrame upon load.



Elijah
6 Aug 2010, 5:55 AM
Maybe I'm doing this incorrectly, but I'm using a panel with an IFrame to load in an external site. The page takes along time to load and when the loading is going on the browser is stuck. It seems that if I load in a static html page. I have an event listening for 'show' and then I redirect the IFrame to the destination the loading does not hang the browser. This works fine in FF.

In I.E. though it has an issue with the javascript body.dom.contentElement any suggestions on how to best redirect the page?

Condor
6 Aug 2010, 6:03 AM
Why do you need body.dom.contentElement?

To get the IFRAME window and document you can use:

var win = iframe.contentWindow || window.frames[iframe.name];
var doc = iframe.contentDocument || iframe.contentWindow.document;

Elijah
6 Aug 2010, 6:21 AM
well it was off of the listener so it was actually this.body.dom.contentElement. But I'll look into what you posted.