Connecting Tech Pros Worldwide Forums | Help | Site Map

View different Pages on firefox or IE

Newbie
 
Join Date: Nov 2006
Posts: 4
#1: Nov 18 '06
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.

Expert
 
Join Date: Oct 2006
Location: NC
Posts: 1,722
#2: Nov 18 '06

re: View different Pages on firefox or IE


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>
Newbie
 
Join Date: Nov 2006
Posts: 4
#3: Nov 18 '06

re: View different Pages on firefox or IE


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.  
Newbie
 
Join Date: Nov 2006
Posts: 4
#4: Nov 18 '06

re: View different Pages on firefox or IE


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.  
Newbie
 
Join Date: Nov 2006
Posts: 4
#5: Nov 18 '06

re: View different Pages on firefox or IE


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>
Reply