Click to See Complete Forum and Search --> : innerHTML = url
Is there a way of setting the innerHTML of an element to the HTML in an external file, as pointed to by a URL.
E.g.
myContainer.innerHTML = contents_of("new_content.htm");
This would be really useful!
gil davis
04-28-2003, 07:30 AM
Not without a lot of hand-waving. The only object that gracefully takes a URL with a mime type of "text/html" in modern browsers is the IFRAME. You can hide the iframe or make it so small no one will notice, and once the file has loaded, you can move the data to wherever you want it.
That's what I figured, I was hoping that there would be another "cleverer" way, but doesn't look like that'll be happening...
Thanks!
That's superb - it's a WYSIWYG editor, so it's using an IFRAME anyway - hence we're commited to IE.
Cheers mate!
gil davis
04-29-2003, 07:48 AM
but I thought IFRAME works in NS, too?
NS 6 and above.
I don't think the various javascript methods (such as execCommand) are implemented in NS - Are they?
No, they are not. document.execCommand is IE only...