pairustwo
12-26-2002, 08:09 PM
I have a script that detects what browser is being used and then pops up and centers a window if using anything newer than IE4 and NS4, Send to an upgrade page otherwise.
It works well in IE 5.5, 6, NS 6, 7, Moz 1, opera 6, (5?) So I know I'm not way off in my thinking.
But in IE 5 when a user clicks on the link it appears that a window pops up for a split second and then disappears. I just learned this as I was passing by a computer that happened to have IE 5 still installed so I can't reproduce it myself.
Two Questions then:
1. How does someone using a PC test in IE5? Can I install an older IE over IE6? This seems ridiculous, is there a simulator?
2. Can anyone take a look and tell me if they see anything that would cause this problem?
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
var the_window = eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=795,height=476,left = 112,top = 59');");
var screen_height = window.screen.availHeight;
var screen_width = window.screen.availWidth;
var left_point = parseInt(screen_width / 2) - 400;
var top_point = parseInt(screen_height / 2) - 250;
the_window.moveTo(left_point, top_point);
}
function fire(){
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
//if NS 6
if (browser_type=="Netscape"&&browser_version>=5)
popUp ("guestbook.php?action=view")
//if IE 5+
else if (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf["MSIE 5"] != -1)
popUp("guestbook.php?action=view")
//if NS4+
else if (browser_type=="Netscape"&&browser_version>=4)
window.location.replace("upgrade.htm")
//Default go to page
else
popUp ("guestbook.php?action=view")
}
</script>
Then
<a href="#" onClick="javascript:fire()">blah</a>
Thanks for all your help
Pairustwo
It works well in IE 5.5, 6, NS 6, 7, Moz 1, opera 6, (5?) So I know I'm not way off in my thinking.
But in IE 5 when a user clicks on the link it appears that a window pops up for a split second and then disappears. I just learned this as I was passing by a computer that happened to have IE 5 still installed so I can't reproduce it myself.
Two Questions then:
1. How does someone using a PC test in IE5? Can I install an older IE over IE6? This seems ridiculous, is there a simulator?
2. Can anyone take a look and tell me if they see anything that would cause this problem?
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
var the_window = eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=795,height=476,left = 112,top = 59');");
var screen_height = window.screen.availHeight;
var screen_width = window.screen.availWidth;
var left_point = parseInt(screen_width / 2) - 400;
var top_point = parseInt(screen_height / 2) - 250;
the_window.moveTo(left_point, top_point);
}
function fire(){
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
//if NS 6
if (browser_type=="Netscape"&&browser_version>=5)
popUp ("guestbook.php?action=view")
//if IE 5+
else if (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf["MSIE 5"] != -1)
popUp("guestbook.php?action=view")
//if NS4+
else if (browser_type=="Netscape"&&browser_version>=4)
window.location.replace("upgrade.htm")
//Default go to page
else
popUp ("guestbook.php?action=view")
}
</script>
Then
<a href="#" onClick="javascript:fire()">blah</a>
Thanks for all your help
Pairustwo