Forum Moderators: open

Message Too Old, No Replies

Browser detect with redirect for mac ie 5.0

mac browser detect redirect

         

schnatz

11:53 am on May 28, 2004 (gmt 0)

10+ Year Member



Ahhh I am trying to get a website live and I am sooo close and yet so far!

I am using a dhtml navigation which comes out of the side and it's working on every browser except on a mac ie5.0 and netscape 4.7 (nothing new there).

I am trying to find a browser detect which allows you to detect only ie 5.0 and only on a mac. It works fine on ie 5.2 and all script I found are all browsers 5 upwards...

It should only redirect to an upgrade your browser page if you are using ie mac 5.0.

Can anybody help - please?

Thanks
Nathalie

Alternative Future

12:31 pm on May 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi schnatz,

Would this do what you are looking for?

<script language="javascript">
Mac = navigator.userAgent.indexOf("Mac") > -1;
n = navigator.userAgent;
msVer = n.substr(n.indexOf("MSIE ")+("MSIE ").length, 3);
if(Mac)if(msVer == 5)//do your redirect here!
</script>

HTH,

-George

edward301

4:02 pm on May 31, 2004 (gmt 0)

10+ Year Member



how do you change that code to redirect all mac based ie versions?

Alternative Future

4:08 pm on May 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi edward301,

<script language="javascript">
Mac = navigator.userAgent.indexOf("Mac") > -1;
n = navigator.userAgent;
ms = n.substr(n.indexOf("MSIE"), 4);
if(Mac)if(ms == 'MSIE')//do your redirect here!
</script>

OR

<script language="javascript">
Mac = navigator.userAgent.indexOf("Mac") > -1;
n = navigator.userAgent;
if(Mac)if(n.indexOf("MSIE"))//do your redirect here!
</script>

Is this what you are after?

-George

edward301

9:52 pm on May 31, 2004 (gmt 0)

10+ Year Member



<script language="javascript">
Mac = navigator.userAgent.indexOf("Mac") > -1;
n = navigator.userAgent;
if(Mac)if(n.indexOf("http://www.myhumblewebsite.com/welcome_mac_users.html"))
</script>

if that redirects all mac users to
[myhumblewebsite.com...]
its wat i want thanx :)

its hard 4 non mac users 2 test that kind of thing :(

RonPK

9:44 pm on Jun 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I were a IE5.0/Mac user, I would not be happy with getting redirected. Why not give those users some basic navigation instead of the fancy DHTML menu?

edward301

10:27 pm on Jun 2, 2004 (gmt 0)

10+ Year Member



It is a well known fact that when a user searches for a website looking for specific information, the website that they visit as result of that search must prove to have the content that they desire given to them straight away as they are unlikely fo bother searching your site for the information that originaly wanted they will continue there search else where. Considering the majority of people use a pcs it is logical for the homepage to be aimed at pc/windows users how ever that content is of no use to mac users so what is the point of showing it to them? when you can send them to a specialy designed homepage that is aimed for there use.

RonPK

7:47 am on Jun 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are plenty of cross browser DHTML menus out there, so there is really no need for a special Mac/IE5.0 page. Most of the Windows-only scripts I've seen also tend to be non-accessible for search engine spiders. IMHO schnatz should reconsider her navigation.

Another thing: maintaining two or more versions of the same page may be possible for amateur sites. In a business environment the costs will soon be considered too high.

Alternative Future

8:32 am on Jun 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just noticed your script is not doing the full check!
if(Mac) checks the OS
n.indexOf("MSIE") checks the browser
After both these conditions have completed then your forward them to the Mac page.

<script language="javascript">
Mac = navigator.userAgent.indexOf("Mac") > -1;
n = navigator.userAgent;
if(Mac)if(n.indexOf("MSIE"))location.replace('http://www.yourdomain.com/mac_users.html');
</script>

HTH,

-George

ghosttownbabe

7:28 pm on Jun 13, 2004 (gmt 0)

10+ Year Member



I'm running into a very similar sounding problem to the one you described. Worse still - it's also happening on Safari. The pages display perfectly on Netscape/Mozilla OS 9 and up and the code has been validated.

I discovered if you put a piece of non-floated content, equal or greater in height to the height of the first float, above the first float, the problem seems to disappear. Wierd but consistent and repeatable. Since this site contains image galleries with images of varying heights, I put the first row and first row only into a table and that fixed the problem.

I'm on PC and have yet to test this in Safari but based on what I'm seeing I'm pretty sure it will work.