Click to See Complete Forum and Search --> : Slow page loading when using iframes


helterskelta
07-23-2004, 04:02 AM
Hi people,

This takes a bit of explaining ..... I have an issue using IE6, concerning iframes that are taking a long time to load. These iframes can sometimes take 10-20 seconds to load. However the problem is not that they are taking a long time to load, this I expect to happen, as there is a lot of server side processing going on in the background to generate each iframe (I am loading 4 iframes, each one is generating a chart from a large database query).

The problem is, that while they are loading if I try to click a link to go to another page, the page doesn't load straight away. Sometimes it will take 10 seconds or until half or all of the iframes have finished loading. Note the link is not in an iframe and the link does not target an iframe. The link is in the main parent page. Also note the server handling these requests is on a dedicated webserver machine, and I am not running it locally. This counts out the issue that the server side processing is slowing my own machine down.

My question is, is there a way to click on a link, and IE immediately loads the next page?

Maybe I need to stop the iframes from loading then load the new URL?

I have tried using <a href="xxx"> and also <a onclick="document.location.href='xxx'"> but both seem slow.

I hope this makes sense!

If anyone has some useful information about this, it would be greatly appreciated.

Cheers

JacksonCochrane
07-23-2004, 08:01 AM
You might try something like the following. It is my understanding that execCommand will work for IE and window.stop() will work for Netscape, if you plan to code for it, as well.

<HTML>
<Head>
<Script Languge=JavaScript>

function getNewLink(){

document.execCommand('Stop');
window.frames['IF1'].document.execCommand('Stop')
window.frames['IF2'].document.execCommand('Stop')
//window.location = "newPage.html"
}
</Script>
</Head>
<Body>
<Div align=center>
<br>
<input type=button value="Some other link" onClick="getNewLink()">
<br>
<br>
<IFRAME
Name = 'IF1'
SRC='1.html'
WIDTH='720'
HEIGHT='250'
Frameborder='yes'
Scrolling='auto'>
</IFRAME>
<br><br>
<IFRAME
Name = 'IF2'
SRC='2.html'
WIDTH='720'
HEIGHT='250'
Frameborder='yes'
Scrolling='auto'>
</IFRAME>
</Body>
</HTML>