View Full Version : ManagedIFrame ondocumentloaded event has no document

12 May 2010, 8:29 AM
Hello friends,

I am working on a project that involves multiple IFRAME's. I'm using the ManagedIFrame object for this. I have all of the latest revisions (as far as I know).

I have sub-classed Ext.ux.ManagedIframe.Panel and added the following code.

* Define the call back functions for asynchronous events.
* @cfg {object} listeners
* When the document is fully loaded into the IFRAME, this
* event will be called. We must clear the eventsFollowFrameLinks
* flag and then inject the scripts.
* @event documentloaded
documentloaded: function(elem)
var doc = elem.getFrameDocument();
var body = doc.getElementsByTagName("body")[0];
var head = doc.getElementsByTagName("head")[0];

If elem.getFrameDocument() fails, you can see that nothing else will work. For the first IFRAME, getFrameDocument() works fine, but for subsequent IFRAME's it returns null.

Please help.

12 May 2010, 11:22 AM
I have been doing some research on this problem.

Line 2723 of miframe-debug.js states the following...

this.dom.src = s;

Where "s" is the url passed to the setSrc method on the Ext.ux.ManagedIFrame.Element object. I noticed that for the first IFRAME, this.dom.contentWindow changes from "about:blank" to the new url content, but on the second invocation, this member variable is "undefined".

I am not certain of any particular events that are triggered by this action, but my next test will be to try and load a page that has little or no javascript. I was loading http://google.com when I observed this problem.

12 May 2010, 11:57 AM

I feel like the original Church Lady from Saturday Night Live!


You can't do what I'm attempting to do across domains!

What a waste of my time!