SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: JavaScript - Redirect for MAC
-
Jan 17, 2001, 16:57 #1
- Join Date
- Sep 2000
- Posts
- 230
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here's what im trying to do:
Redirect a user if their using MAC IE 4 or below.
Here's my code:
<!--IE/Mac redirect-->
<script language="JavaScript">
{
if(navigator.userAgent.indexOf('Mac') != -1 && navigator.appName.indexOf('Microsoft') !=-1 && navigator.appVersion.indexOf('4.')>=0)
{ window.location.href="index.html"; }
}
</script>
<!--end script-->
--It works but it also redirects IE 5 users.
Any advice or things I should fix with this code.
Thanks
-
Jan 17, 2001, 17:31 #2
- Join Date
- Jul 1999
- Location
- SC, USA
- Posts
- 390
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try using this:
if(navigator.userAgent.indexOf('Mac') != -1 && navigator.appName.indexOf('Microsoft') !=-1 && navigator.appVersion.indexOf('4.')>=0 && !document.getElementById){
aDogModerator at www.javascriptcity.com/forums/
Bookmarks