By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,474 Members | 1,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,474 IT Pros & Developers. It's quick & easy.

View different Pages on firefox or IE

P: 4
I looking for one were you go to a site and if you using mozilla firefox. it will redirect you to index_firefox.html. If you using ie it will be index_IE.html.


For example: you go to www.website.com using your firefox and the index page will redirect to the right browser page like index_firefox.html.


If you use IE. it will redirect you to index_IE.html



I use to have a script before but I lost it.
Nov 18 '06 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 1,892
Here is how you find the browser just replace alert with redirect.



Expand|Select|Wrap|Line Numbers
  1. <HEAD>
  2. <SCRIPT language="JavaScript">
  3. <!--
  4. var browserName=navigator.appName; 
  5. if (browserName=="Netscape")
  6. alert("Hi Netscape User!");
  7. }
  8. else 
  9. if (browserName=="Microsoft Internet Explorer")
  10. {
  11. alert("Hi, Explorer User!");
  12. }
  13. else
  14. {
  15.     alert("What ARE you browsing with here?");
  16. }
  17. }
  18. //-->
  19. </SCRIPT>
  20. </HEAD>
Nov 18 '06 #2

P: 4
I try redirect and did not work or some reason.

Expand|Select|Wrap|Line Numbers
  1. <HEAD>
  2. <SCRIPT language="JavaScript">
  3. <!--
  4. var browserName=navigator.appName; 
  5. if (browserName=="Netscape")
  6. redirect("http://blank.com/Netscape.html");
  7. }
  8. else 
  9. if (browserName=="Microsoft Internet Explorer")
  10. {
  11. redirect("http://blank.com/IE.html");
  12. }
  13. }
  14. //-->
  15. </SCRIPT>
  16. </HEAD>
  17.  
  18.  
  19.  
Nov 18 '06 #3

P: 4
Nvm I found a new way.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <SCRIPT><!--Free Browser Detection Forwarding Script Code Found At http://www.DesignerWiz.com-->
  3. <!--Development Resource & JavaScript Public Archive Center-->
  4. browser = navigator.appName
  5. ver = navigator.appVersion
  6. version = ver.substring(0,1)
  7. if (browser=="Netscape") {
  8.   if (version=="3")
  9.     document.location.href=""
  10.   if (version=="4")
  11.     document.location.href=""
  12. }
  13. if (browser=="Internet Explorer") {
  14.   if (version=="3")
  15.     document.location.href=""
  16.   if (version=="4")
  17.     document.location.href=""
  18.   if (version=="5")
  19.     document.location.href=""
  20. }
  21. </SCRIPT>
  22.  
  23.  
Nov 18 '06 #4

P: 4
nevermind on my last 2 topics. This one really works. Thank you!

I just added document.location.href=

Expand|Select|Wrap|Line Numbers
  1. <HEAD>
  2. <SCRIPT language="JavaScript">
  3. <!--
  4. var browserName=navigator.appName; 
  5. if (browserName=="Netscape")
  6. document.location.href=("Netscape.html");
  7. }
  8. else 
  9. if (browserName=="Microsoft Internet Explorer")
  10. {
  11. document.location.href=("IE.html");
  12. }
  13. }
  14. //-->
  15. </SCRIPT>
  16. </HEAD>
Nov 18 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.