[thelist] javascript syntax

Hassan Schroeder hassan at webtuitive.com
Thu May 9 13:21:01 CDT 2002


dn at dittodesign.co.uk wrote:
>
> Im trying to redirect Mac users and I just cannot get
> my bit of java [sic] working -
>
> if (navigator.platform=='mac'){window.location='NS/index.htm'};

Are you sure that 'mac' is what you're looking for? In my server
logs, all I see are user agent strings of 'Mac_PowerPC' ...

Maybe you want something like

  if ( navigator.platform.toLowerCase().indexOf('mac') > -1 )

instead?
--
H*
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

    -- creating dynamic Web sites and applications since 1994 --



More information about the thelist mailing list