Page 1 of 1

Passing HTML Code to an iframe?

Posted: Wed Mar 24, 2010 7:20 pm
by Randwulf
I have the following chunk of code:

Code: Select all

 
preload = new Element('iframe', {
    'src': URL,
    'id': mediaId,
    'width': mediaWidth,
    'height': mediaHeight,
    'allowtransparency': 'true',
    'frameborder': 0
    });
I have a script that generates some HTML code which is saved as string variable "content" and I'd like to display that code in this iframe. Is that possible? Or can an iframe only be used to access a URL?

Thanks

Re: Passing HTML Code to an iframe?

Posted: Thu Mar 25, 2010 12:24 pm
by kaszu

Re: Passing HTML Code to an iframe?

Posted: Thu Apr 29, 2010 10:26 am
by nazg
I dont know what exactly you are trying to do so the following suggestion may not be of use. Try php. You can pass strings of html around no problem and have the iframe load the php. Or templates. I have used mako for python templating which allows me to embed python scripts and code into webpages