Help! with simple browser redirect script...

Results 1 to 2 of 2

Thread: Help! with simple browser redirect script...

  1. #1
    Join Date
    Dec 1969

    Default Help! with simple browser redirect script...

    Hello, my script is to block all from the site UNLESS They have ie 4+...they are told this ahead of time and there is no problem, it&#039s just for a certain section that needs it.<BR><BR>Here&#039s the simple script:<BR>&#060;script language="javascript"&#062;<BR><BR>var browser_type=navigator.appName<BR>var browser_version=parseInt(navigator.appVersion)<BR> if (browser_type=="Microsoft Internet Explorer"&&browser_version&#062;=4) {<BR> alert("You can enter since you have the appropriate browser. Can you believe that guy with that bad browser? Some people these days...");<BR> location.href="index5.html"<BR> }<BR>else if (browser_type=="Netscape"&&browser_version&#062;=1 )<BR>alert("Excuse me, you must use Internet Explorer 4 or above to take the test. You will be taken to a page to download it. Thank you very much. You are using "+navigator.appName +" "+navigator.appVersion+".");<BR> window.location="sorry.htm";<BR>&#060;/script&#062;<BR><BR>Problem is instead of blocking netscape, I want the command in the &#039else&#039 to say, if not ie&#062;= do I do that?<BR><BR>Thanks.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Help! with simple browser redirect script...

    if (browser_type=="Microsoft Internet Explorer") {<BR><BR>// The visitor has IE, determine what version<BR>if (browser_version&#062;=4) {<BR>// they are using 4 or greater, do whatever here...<BR>} else {<BR>//they are using a version of IE prior to 4<BR>}<BR>} else if ... // do the netscape test<BR><BR>Happy Programming!<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts