script question

Results 1 to 2 of 2

Thread: script question

  1. #1
    Join Date
    Dec 1969

    Default script question

    The following function appears in code that I have taken over from another developer...onload, CheckBrowser is called. From my understanding, NS4 and IE4 are considered min and fall into the is.min &#039;if statement&#039; and are redirected to raa_ns.html(if ns) and raa_ie.html(if ie) all others should fall into else - raa_ns.html. One user, using NS 6 is having problems, when he loads this page it keeps looping and doesn&#039;t redirect - he does not have problems when using IE. NS6 should redirect to raa_ns.html, correct? Any ideas as to why they are having problems? Thanks<BR><BR>function BrowserCheck() {<BR> var b = navigator.appName;<BR> if (b=="Netscape") this.b = "ns";<BR> else if (b=="Microsoft Internet Explorer") this.b = "ie";<BR> else this.b = b;<BR> this.version = navigator.appVersion;<BR> this.v = parseInt(this.version);<BR> this.ns = (this.b=="ns" && this.v&#062;=4);<BR> this.ns4 = (this.b=="ns" && this.v==4);<BR> this.ns5 = (this.b=="ns" && this.v==5);<BR> = (this.b=="ie" && this.v&#062;=4);<BR> this.ie4 = (this.version.indexOf(&#039;MSIE 4&#039;)&#062;0);<BR> this.ie5 = (this.version.indexOf(&#039;MSIE 5&#039;)&#062;0);<BR> this.min = (this.ns&#124&;<BR>}<BR><BR>function CheckBrowser (){<BR> is = new BrowserCheck();<BR> if(is.min){<BR> if(is.ns){<BR> location.href="raa_ns.html";<BR> }else if({<BR> location.href="raa_ie.html";<BR> }<BR> }else{<BR> location.href="raa_ns.html";<BR> }<BR>}

  2. #2
    Join Date
    Dec 1969

    Default No possible way...

    ...for that code to loop.<BR><BR>The code is kind of hokey. You could accomplish 100% the same thing by doing<BR><BR>function CheckBrowser (){<BR> var is = new BrowserCheck();<BR> location.href = ( ? "raa_ie.html" : "raa_ns.html");<BR>}<BR><BR>But it can&#039;t loop.<BR><BR><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