is this possible

  • cris02
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Sep 27, 2003
  • Posts: 38
  • Loc: Manila, Philippines
  • Status: Offline

Post October 12th, 2003, 12:12 am

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

Post October 12th, 2003, 12:12 am

  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post October 12th, 2003, 12:39 am

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
  • No Avatar
  • Joined: Sep 27, 2003
  • Posts: 38
  • Loc: Manila, Philippines
  • Status: Offline

Post October 12th, 2003, 12:54 am

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
  • Joined: Aug 07, 2003
  • Posts: 51
  • Loc: Singapore
  • Status: Offline

Post October 12th, 2003, 1:28 am

Here's a link for you:

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

^_^
  • RichB
  • Guru
  • Guru
  • User avatar
  • Joined: May 17, 2003
  • Posts: 1121
  • Loc: Boston
  • Status: Offline

Post October 12th, 2003, 1:48 am

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.
Free Programming Resources
  • cris02
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Sep 27, 2003
  • Posts: 38
  • Loc: Manila, Philippines
  • Status: Offline

Post October 12th, 2003, 2:21 am

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

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 116 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.