Re: Transfer javascript code from iFrame to a DIV
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Transfer javascript code from iFrame to a DIV

From: Thomas 'PointedEars' Lahn <PointedEars@web.de>
Date: Sat Apr 29 2006 - 01:48:51 CEST

sameergn@gmail.com wrote:

> 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;

<URL:http://pointedears.de/scripts/test/whatami#inference>
 
> 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?

`innerHTML' is a proprietary feature, so everything regarding it can be
considered correct behavior, even bugs.

> (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)

This is utter nonsense. Simply make the IFrame visible in the first
place, and use CSS to style it.

PointedEars

-- 
A man who works with his hands is a laborer; a man who works with his
hands and his brain is a craftsman; but a man who works with his hands
and his brain and his heart is an artist.
  -- Louis Nizer, lawyer (1902-1994)
Received on Mon May 1 05:26:26 2006