sameergn@gmail.com wrote:
> Hi,
>
> I have HTML form whose target is an invisible IFrame. After the IFrame
> is loaded completely,
> following code transfers contents of IFrame to DIV
>
> document.getElementById("mainDiv").innerHTML =
> test_iframe.document.body.innerHTML;
>
> but this does not seem to carry over the Javascript code from IFrame to
> DIV.
> Can anyone comment if this is the correct behavior or a bug?
> (The requirement is to submit a form and update only portion of screen,
> without using
> AJAX. A DIV cannot be target of the FORM, hence the IFrame->DIV route)
>
> Thanks,
> Sameer
Is the javascript inside the body of the IFRAME? To copy the contents
completely as they are, I would use
var content = test_iframe.document.body.cloneNode( true );
document.getElementById("mainDiv").appendChild( content );
Received on Mon May 1 05:26:29 2006