Angyl
07-21-2005, 11:31 PM
I have the following script (which technically I got from Dynamic Drive but I couldn't find it again to reference which is why I'm posting here)
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
//if NS 4+
if (browser_type=="Netscape"&&browser_version>=4)
window.location.replace("http://url")
//if IE 4+
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
window.location.replace("http://url")
//Default goto page (NOT NS 4+ and NOT IE 4+)
else
window.location="http://url"
Anyway, it works. What I like about it is the action happens onload - without a link having to be clicked or anything.
What I want it to do is not so much forward the page as open a new window with a defined url when the page the script is on loads.
So pretty much I want a "open a new window" script but without the necesseity of having to click on a link. Does that make sense?
Can it be done with this script or do I need a whole new script?
Thanks!
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
//if NS 4+
if (browser_type=="Netscape"&&browser_version>=4)
window.location.replace("http://url")
//if IE 4+
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
window.location.replace("http://url")
//Default goto page (NOT NS 4+ and NOT IE 4+)
else
window.location="http://url"
Anyway, it works. What I like about it is the action happens onload - without a link having to be clicked or anything.
What I want it to do is not so much forward the page as open a new window with a defined url when the page the script is on loads.
So pretty much I want a "open a new window" script but without the necesseity of having to click on a link. Does that make sense?
Can it be done with this script or do I need a whole new script?
Thanks!