Menu
I have a web page that works in all the browsers i’ve tried it with, but doesn’t work quite the same. While I try to find a way to make it work the same in every browser, How can I redirect any user that isn’t using IE?
How can I redirect any user that isn't using IE?[/QUOTE]
<i>
</i><script type="text/javascript">var ie6=0</script>
<script language="vbscript" type="text/vbs">
ua=navigator.userAgent
ie6=CInt(Mid(ua,InStr(ua,"MSIE")+5,1))<=6
</script>
<script type="text/javascript">
if(!ie6)location.href='standards_compliant.htm'
</script>
You can't test for the presence of MSIE, even in the UA string. If the browser is cloaked it will be present.[/QUOTE]
Ok, I see. You would send IE to another page, instead of the other way round.[/QUOTE]
<i>
</i>ua=navigator.userAgent
ie6=[COLOR=Blue]CInt[/COLOR]([COLOR=Blue]Mid[/COLOR](ua,[COLOR=Blue]InStr[/COLOR](ua,[COLOR=DarkOliveGreen]"MSIE"[/COLOR])+5,1))<=6
returns true if the version is <= 6<i>
</i>if(!ie6)location.href='standards_compliant.htm'
redirects anything that isn't IE6 win or lesswrong way round JPnyc.
It is the [B]navigator.appName[/B] and [B]navigator.appVersion[/B] properties that are changed by browsers to identify them as something else.[/QUOTE]
Best way is to code for mozilla browsers, forget the rest. Eventually all browsers will adopt mozilla standards anyway as they are w3c compliant. Yess even IE.[/QUOTE]
As already stated, it sounds like you're writing for the wrong browser.[/QUOTE]
<i>
</i>[COLOR=Blue]<script[/COLOR] [COLOR=Red]type=[/COLOR]"text/javascript">
var ie=0
[COLOR=Blue]</script>[/COLOR]
[COLOR=Blue]<script[/COLOR] [COLOR=Red]language=[/COLOR]"vbscript" [COLOR=Red]type=[/COLOR]"text/vbs">
ie=1
[COLOR=Blue]</script>[/COLOR]
[COLOR=Blue]<script[/COLOR] [COLOR=Red]type=[/COLOR]"text/javascript">
if(!ie)location.href='page.htm'
[COLOR=Blue]</script>[/COLOR]
0.1.9 — BETA 5.15