Hi,
When an applet is loading the browser freezes for several seconds during which the page stops loading and scrollers don't work either. I understand it is a general issue with the applets. I wonder if there is a javascript that would cause applet to start loading only after the entire page is loaded?
The original script that opens the applet looks like:
<div><applet code="whatever.class"></applet></div>
Thanks.
No, Javascript cannot load an applet. But you could use setTimeout() within a function to delay the loading.
Philip,
Thanks for reply. I am not an expert on coding (the applet was provided by someone else). Do I need to modify the .class program to do this, or I can set timeout externally? If it can be a separate script, would it be too much to ask for an exact code?
<script type = "text/javascript">
function loadApplet() {
if (navigator.javaEnabled()) {
document.write('<div><applet code="whatever.class"></applet></div>');
}
}
window.setTimeout("loadApplet()",5000); // 5 seconds delay
</script>
Philip,
Thanks for your help. It's getting closer it loads applet with delay as intended, except when applet is loading it replaces entire content of the page, i.e. only applet remains on the page.
Ah, that is because document.write statements must be run before the page finishes loading. But I always thought that this means that they must be either in the body of the page or in functions called from the body of the page (as here). Obviously the delay allows the page to complete loading.
I am afraid that I am not able to make any more suggestions - but perhaps someone else could suggest another method or technique.