December 19th, 2003, 04:25 PM
Loading frameset html into div
I use this system to dynamically load pages beacuase my website is graphics heavy (unfortunately the system does indeed exclude netscape for now...) I found it on the internet somewhere, it looks like this:
When a page calls loadPage, then this function loads the asked page into the bufferFrame that is invisible, as soon as this is loaded a script call is made from the loaded page: loadPageFinish( 'contents' ) and the page is copied and visible.
function loadPage( url )
parent.bufferFrame.document.location = nUrl;
function loadPageFinish( id )
document.all[id].innerHTML = parent.bufferFrame.document.body.innerHTML;
<iframe style="display:none" name="bufferFrame"></iframe>
However! This won't work for external pages as they do not call my loadPageFinish function...
So, I thought I might use frames, then copy the innerHTML of the external page into the DIV. This is also not possible because external domain pages are protected from anything that might alter the content!!
Then I thought, I don't need to copy the innerHTML, I can just make the innerHTML the frameset I need, like this:
but that doesn't load anything either. I kinda wanna bet on this last option being able to work somehow!!
document.all['contents'].innerHTML = '<frameset rows="*"><frame name="ExtMain" noresize src="'
Who has any suggestions, on what I did wrong, or whatever other thing I could try?
Last edited by RwDwR; December 19th, 2003 at 04:33 PM.
December 20th, 2003, 04:02 AM
I also tried doing the following
document.all[id].innerHTML = parent.bufferFrame.document.body.outerHTML;
(unspecified error comes up)
It doesn't work, BUT, when I try this:
document.all[id].innerText = parent.bufferFrame.document.body.outerHTML;
then the page shows this:
<FRAMESET border=0 frameSpacing=0 rows=* frameBorder=0>
<FRAME name=ExtMain marginWidth=0 marginHeight=0 src="http://www.anysite.com/a_page.php" frameBorder=NO noResize>
why doesn't this work??????
Last edited by RwDwR; December 20th, 2003 at 04:04 AM.
December 20th, 2003, 04:12 AM
Ok, I think I figured out why it aint working...
All other content that does work is allowed within the body tag. i forgot that the div element is not a html page, but just an element of which I was setting the innerHTML to a certain value.
HOWEVER, I would still like to be able to display any page from another domain inside my nice DIV