Gordo
12-12-2002, 04:13 AM
"Browser Redirect Script" from DD (http://www.dynamicdrive.com/dynamicindex9/bredirect.htm) ... in the process of modifying for my needs. I can't get the IE line to work. It's supposed to stay on the page in which I place this script, and load the iframe should it be necessary -- such as with www.website.com/services/index.html?someservice.html -- where someservice.html will load in the iframe. I'm getting errors with the portion in bold. No, I don't "know" JavaScript. But, I follow along from time to time. I await your reply and/or solution(s). Thanks!
<script>
//Browser redirect Script- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and Terms Of Use,
//visit dynamicdrive.com
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
//if NS 6
if (browser_type=="Netscape"&&browser_version>=5)
window.location.replace("index_n4.html")
//if IE 4+
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
{ window.frames['content'].location = window.location.search.slice(1); }
//if NS4+
else if (browser_type=="Netscape"&&browser_version>=4)
window.location.replace("index_n4.html")
//Default goto page (NOT NS 4+ and NOT IE 4+)
else
window.location="http://www.dynamicdrive.com"
</script>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Below is what I started to type in this post. I thought it might be easy for one of you to add in an N6 spec in the following body onload statement. So, feel free to answer this if applicable. THANKS.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I have the following browser checker to redirect N4 users to an alternalte page. How can I make N6 users go to the same page!?
<body onload="if(document.layers){window.location='index_n4.html'} else { if (window.location.search) { window.frames['content'].location = window.location.search.slice(1); } }">
The else part loads an iframe (if applicable). I know N6 can normally handle iframes, but not the way I'm doing it. So, I need it redirected.
<script>
//Browser redirect Script- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and Terms Of Use,
//visit dynamicdrive.com
var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)
//if NS 6
if (browser_type=="Netscape"&&browser_version>=5)
window.location.replace("index_n4.html")
//if IE 4+
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
{ window.frames['content'].location = window.location.search.slice(1); }
//if NS4+
else if (browser_type=="Netscape"&&browser_version>=4)
window.location.replace("index_n4.html")
//Default goto page (NOT NS 4+ and NOT IE 4+)
else
window.location="http://www.dynamicdrive.com"
</script>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Below is what I started to type in this post. I thought it might be easy for one of you to add in an N6 spec in the following body onload statement. So, feel free to answer this if applicable. THANKS.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I have the following browser checker to redirect N4 users to an alternalte page. How can I make N6 users go to the same page!?
<body onload="if(document.layers){window.location='index_n4.html'} else { if (window.location.search) { window.frames['content'].location = window.location.search.slice(1); } }">
The else part loads an iframe (if applicable). I know N6 can normally handle iframes, but not the way I'm doing it. So, I need it redirected.