philipmac
07-12-2007, 10:29 PM
Hi,
If I run a js script -onload saying
document.execCommand("Stop");
execution of the download will stop immediately and the page will not load.
I need to check what browser they are using, and what JRE they have installed. I have this working too onload.
However what I want it to do is to stop execution and put up an alert saying "Please get the Sun JRE" only if the JRE is MS and the browser is MS, and carry on loading in all other cases.
Any idea why document.execCommand("Stop"); only works when it is in the main body of the js file, and does not work for me if it is in a function?
here is some code...
function philStop()
{
browsername = navigator.appName;
var applet = document.myApplet;
var version = applet.getJavaVersion();
if((browsername.indexOf("Microsoft")!=-1) && (version == "MS java runtime thing"))
{
alert("MS Browser plus wrong JRE, goto Sun, get one that is not broken.");
document.execCommand("Stop");
}
}
If I run a js script -onload saying
document.execCommand("Stop");
execution of the download will stop immediately and the page will not load.
I need to check what browser they are using, and what JRE they have installed. I have this working too onload.
However what I want it to do is to stop execution and put up an alert saying "Please get the Sun JRE" only if the JRE is MS and the browser is MS, and carry on loading in all other cases.
Any idea why document.execCommand("Stop"); only works when it is in the main body of the js file, and does not work for me if it is in a function?
here is some code...
function philStop()
{
browsername = navigator.appName;
var applet = document.myApplet;
var version = applet.getJavaVersion();
if((browsername.indexOf("Microsoft")!=-1) && (version == "MS java runtime thing"))
{
alert("MS Browser plus wrong JRE, goto Sun, get one that is not broken.");
document.execCommand("Stop");
}
}