Tony Bell

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromTony Bell
ToMe
SubjectRedirect page for IE5 with Mac
Date8 March 05 16:46
Hi,
I have been looking at your Browser sniffer script, I basically understand
it. I also read your articles saying that designers must design their sites
for all. I agree but I have a particular problem.
My site is designed in XHTML1.0 and I have been told that IE5 + Mac does
not work correctly. I am trying to get approval from the NGfL  (National
Grid for Learning.) This is the only thing stopping me get approval.

Redirect page for IE5 with Mac, I have written this simple script
redirecting IE5+Mac to a seperate page ../macfront.html

<script type="text/javascript">
function redirectPage() {
if (document.all&&document.getElementById&&navigator.savePreferences)
	window.location.href='/macfront.html'
else  window.open}
</script>
<body onload="redirectPage()">

I can not check it works in Mac but  Opera7 is being found and wrongly
dispalys the redirect page (not  IE6 or Mozzilla)

I did sucesssfully try out this code (window.opera&&document.childNodes) it
redirected in Opera7 (not IE or Mozzzilla).

Could you help me with this code.

Regards
Tony Bell
FromMe
ToTony Bell
SubjectRe: Redirect page for IE5 with Mac
Date16 March 2005 14:01
Tony,

Sniffing is a horrible business, and should be avoided if at all possible.

However, if you feel this is your only answer, you should find that, at the
moment at least, this should detect only IE 5+ on Mac:
if( window.ActiveXObject && window.ScriptEngine && ScriptEngine() == 'JScript'
&& !window.opera && !navigator.__ice_version && !window.attachEvent )

As for when browsers change and start supporting things they do not support
at the moment, well, let's hope you are still around to fix it :)

Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.