View Full Version : autom. redirect if macintosh

01-14-2003, 02: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.)

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

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

01-15-2003, 09: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!