C
Christopher Benson-Manica
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.getElementById( 'theIFrame' ).location=myUrl;
document.getElementById( 'theIFrame' ).src=myUrl;
window.document.theIFrame.location=myUrl;
var iframe=document.createElement( 'iframe' );
iframe.src=myUrl;
document.body.appendChild( iframe );
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.getElementById( 'theIFrame' ).location=myUrl;
document.getElementById( 'theIFrame' ).src=myUrl;
window.document.theIFrame.location=myUrl;
var iframe=document.createElement( 'iframe' );
iframe.src=myUrl;
document.body.appendChild( iframe );