Forum Moderators: open
<SCRIPT LANGUAGE="Javascript">
var browser1 = navigator.appName;
if (browser1 == "Microsoft Internet Explorer"){
WindowOpen();
}else{
window.location.href="page2.htm";
}
</SCRIPT>
This works fine; however, I am getting a javascript error when (page1.htm) loads. Here is how I have my pages organized.
1. Index.html - this page initiates the pop up window automatically -includes the onLoad="popup();">
2. page1.htm - initiates the redirect for Netscape users - includes the redirect script
3. page2.htm - Netscape users page
This might sound confusing, but I need to know why I am receiving a javascript error.
Index.html includes the popup() event. This event initiates the pop up window (page1.htm). On (page1.htm) I have included the redirect script; this redirects Netscape users to (page2.htm)
The error occurs because of the redirect script on page1.htm. Sorry for frying your brain to try to figure out the problem. Thanks
What is the bold piece of code calling. Do a find for WindowOpen on page1.htm and post the other piece of code you find. If you don't find anything thats your error.
Basically, what I want is for my Netscape users to be redirect to (page2.htm), automatically, as a pop up window, as well as my IE users to be redirected to (page1.htm), as a pop up window. Again, sorry if this sounds confusing.
function WindowOpen() {
var newWin = window.open("features.htm", "method_desc", "status=no,width=755,height=480")
}
//STOP HIDING -->
</SCRIPT>
</head>
<BODY onLoad="WindowOpen();return false;">
<SCRIPT LANGUAGE="Javascript">
var browser1 = navigator.appName;
if (browser1 == "Microsoft Internet Explorer"){
var newWin = window.open("page1.htm", "method_desc", "status=no,width=755,height=480");
}else{
var newWin = window.open("page2.htm", "method_desc", "status=no,width=755,height=480");
}
</SCRIPT>
<script>
if (is_gecko)
{
var newWin = window.open("page2.htm", "method_desc", "status=no,width=755,height=480");// JavaScript here for user agents implementing Gecko layout engine}
else if (is_nav4)
{
var newWin = window.open("page2.htm", "method_desc", "status=no,width=755,height=480"); // JavaScript here for Navigator 4
}
else if (is_ie5up)
{
var newWin = window.open("page1.htm", "method_desc", "status=no,width=755,height=480");
// JavaScript here for IE 4 and later
}
else if (is_nav3 ¦¦ is_opera)
{
// JavaScript here for Nav3 and Opera
}
else
{
// JavaScript here for Nav2 and IE 3
}
</script>
This way you can decide what you want for different versions.