dustismo
30 Aug 2007, 11:58 AM
Hello,
I am trying to get some simple iframe lazy loading to work. When the iframe loads it triggers a function in the parent frame which grabs the dom node from the iframe and appends it to a div. This works great in firefox, but I cannot get it to work in ie.
Here is the function that is called on the parent
/* divId is the div in the parent which should be appended to */
renderPartial = function(divId) {
var elem = Ext.Element.get(divId);
//get the dom node from the iframe
var frameElement = Ext.getDom("iframe").contentWindow.document.getElementById('partial');
//the following alert successfully shows the innerHTML, so we are getting the node.
//alert(frameElement.innerHTML);
//doesn't work
elem.appendChild(frameElement);
//also doesn't work
elem.appendChild(Ext.Element.get(frameElement));
//also doesn't work
elem.insertHtml(frameElement.innerHTML);
//this is the only thing that works
elem.innerHTML = frameElement.innerHTML;
I have been trying tons of variations and only the innerHTML one works in IE. Problem is, I need to move the node with scripts and all, not just the html markup. Is this possible? Does anybody know what the problem is??
Thanks for any help,
Dustin
I am trying to get some simple iframe lazy loading to work. When the iframe loads it triggers a function in the parent frame which grabs the dom node from the iframe and appends it to a div. This works great in firefox, but I cannot get it to work in ie.
Here is the function that is called on the parent
/* divId is the div in the parent which should be appended to */
renderPartial = function(divId) {
var elem = Ext.Element.get(divId);
//get the dom node from the iframe
var frameElement = Ext.getDom("iframe").contentWindow.document.getElementById('partial');
//the following alert successfully shows the innerHTML, so we are getting the node.
//alert(frameElement.innerHTML);
//doesn't work
elem.appendChild(frameElement);
//also doesn't work
elem.appendChild(Ext.Element.get(frameElement));
//also doesn't work
elem.insertHtml(frameElement.innerHTML);
//this is the only thing that works
elem.innerHTML = frameElement.innerHTML;
I have been trying tons of variations and only the innerHTML one works in IE. Problem is, I need to move the node with scripts and all, not just the html markup. Is this possible? Does anybody know what the problem is??
Thanks for any help,
Dustin