...

View Full Version : autom. redirect if macintosh



wwwolf
01-14-2003, 01:15 PM
Does anyone know a Javascript that automatically redirects a surfer to another page if he is using a Macintosh, whatever the Mac-operating system is or the browser he uses? (This should happen to the Mac-user only: the PC user isn't redirected.)
Thanks!

beetle
01-14-2003, 03:50 PM
var agt = navigator.userAgent.toLowerCase();
var is_mac = ( agt.indexOf( "mac" ) != -1 );

if ( is_mac ) top.location.replace( "somepage.htm" );

wwwolf
01-15-2003, 08:56 AM
Thanks for the Javascript... I still have a problem though: I have a domain name "www.allemaalfeesjes.be" which refers to a longer domain name, i.e. "http://users.pandora.be/wwwolf/allemaalfeesjes/index.html".

The Javascript only works when you use the longer domain name, not when you access the site through the short domain name. Does anyone know how I can solve this problem?

Thanks thanks thanks!
Rolf



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum