RE: iframe ... does it have an innerHTML ?

Martinez, Andrew
Wed, 28 Jun 2006 12:41:35 -0000

Important to remember that using document.open/close/write from javascript
during non-loading period will cause the current document context to reset,
meaning you lose what was previously there.

-          var iFrame = document.createElement(''IFRAME'');
-          iFrame.src = "/"; //pretty sure you don''t need
this
-          iFrame.contentWindow.document.body.innerHTML =
"blarrrrrrr";
-          iFrame.contentWindow.document.body.innerHTML += "more
BLARRRRRRRRR";


-Andrew Martinez

-----Original Message-----
From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]On
Behalf Of Gregory Hill
Sent: Tuesday, June 27, 2006 4:51 PM
To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: RE: [Rails-spinoffs] iframe ... does it have an innerHTML ?

This should work:

        var iFrame   = document.createElement(''IFRAME'');
        iFrame.src = ''/'';
        iFrame.contentWindow.document.open();
        iFrame.contentWindow.document.write(sDocument);
        iFrame.contentWindow.document.close();

Greg

  _____

From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]
On Behalf Of Sam
Sent: Tuesday, June 27, 2006 2:43 PM
To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: [Rails-spinoffs] iframe ... does it have an innerHTML ?

If I dynamically create a hidden iframe, how could I add a document in a string
to that element?

e.g.,

var sDocument = '' Hello
world. '';

I''ve tried several variations of appendChild, innerHTML,
document.innerHTML, createTextNode.

Argh!