is this possible

  • cris02
  • Beginner
  • Beginner
  • cris02
  • Posts: 38
  • Loc: Manila, Philippines

Post 3+ Months Ago

redirection in javascript depends on her operating system? win98 & winXP? :P :P :P
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Yeah it's possible, but why would you do it that way?

It would make more sense to redirect dependant on browser.
  • cris02
  • Beginner
  • Beginner
  • cris02
  • Posts: 38
  • Loc: Manila, Philippines

Post 3+ Months Ago

because i have some staff that works on winXP, but doesn't work in win98. and i have some code that work in win98 but doesn't work in winxp? :) :) :) hope someone help me. :)
  • teyjohn
  • Beginner
  • Beginner
  • User avatar
  • Posts: 51
  • Loc: Singapore

Post 3+ Months Ago

Here's a link for you:

http://www.mozilla.org/docs/web-developer/sniffer/browser_type_oo.html

^_^
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

You might try something like this:
Code: [ Select ]
<script language="javascript">
<!--
uaString = navigator.userAgent;

if(uaString.indexOf("98")!=-1)
location.href="http://www.yahoo.com";

else if(uaString.indexOf("NT 5.1")!=-1)
location.href="http://www.lycos.com";

else
location.href="http://www.somedefaultpage.com";
//-->
</script>
  1. <script language="javascript">
  2. <!--
  3. uaString = navigator.userAgent;
  4. if(uaString.indexOf("98")!=-1)
  5. location.href="http://www.yahoo.com";
  6. else if(uaString.indexOf("NT 5.1")!=-1)
  7. location.href="http://www.lycos.com";
  8. else
  9. location.href="http://www.somedefaultpage.com";
  10. //-->
  11. </script>


I'm not positive how XP reports itself - I think it's as NT 5.1. If you're running XP now you can click here and see the whole userAgent string. You might want to check it with Netscape too since there are sometimes minor differences in how they report stuff. For example, IE reports 98 as "Windows 98" and NE as "Win98" which is why I just used 98 in the test above.
  • cris02
  • Beginner
  • Beginner
  • cris02
  • Posts: 38
  • Loc: Manila, Philippines

Post 3+ Months Ago

Thanks guys,, its work for me.. :) :) :)

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 160 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.