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

Gregory Hill
Tue, 27 Jun 2006 20:51:21 -0000

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!