I want to load content into an iframe with script. None of the
following methods, however, work on all browsers - any suggestions
would be appreciated.
// Assume that there is an element whose name and id are both
// 'theIFrame'.
var myUrl='http://www.yahoo.com'
document.getEle mentById( 'theIFrame' ).location=myUr l;
document.getEle mentById( 'theIFrame' ).src=myUrl;
window.document .theIFrame.loca tion=myUrl;
var iframe=document .createElement( 'iframe' );
iframe.src=myUr l;
document.body.a ppendChild( iframe );
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
following methods, however, work on all browsers - any suggestions
would be appreciated.
// Assume that there is an element whose name and id are both
// 'theIFrame'.
var myUrl='http://www.yahoo.com'
document.getEle mentById( 'theIFrame' ).location=myUr l;
document.getEle mentById( 'theIFrame' ).src=myUrl;
window.document .theIFrame.loca tion=myUrl;
var iframe=document .createElement( 'iframe' );
iframe.src=myUr l;
document.body.a ppendChild( iframe );
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Comment