Forum Moderators: open

Message Too Old, No Replies

Script problem

Browsers

         

Ove

12:47 pm on Feb 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i got ie 6,0 and dont get some menus from a site here is the code i think its because 6,0 is to new for that script maybe iam right ?

//Default browsercheck, added to all scripts!
function checkBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 ¦¦ this.ie4 ¦¦ this.ns4 ¦¦ this.ns5)
return this

This is not the whole script

Can someone help me?

/Ove

joshie76

1:14 pm on Feb 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



function checkBrowser()
{
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=((this.ver.indexOf("MSIE 5")>-1 ¦¦ this.ver.indexOf("MSIE 6")>-1)&& this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 ¦¦ this.ie4 ¦¦ this.ns4 ¦¦ this.ns5)
return this
}

I've modified your script so that it will treat IE6 just the same is IE5... this will probably fix your problems. The bit I've added is coloured in for you.

(edited by: joshie76 at 2:11 pm (utc) on Feb. 5, 2002)

Ove

1:18 pm on Feb 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks alot

Iam scared to death about scripts i dont know nothing about it. and when a client have that thing on their pages i get sick in my nerves

Thanks
/Ove

joshie76

1:18 pm on Feb 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just noticed that the OR bars in JS post here like this ¦. These will need to be replaced by the real vertical bars* for your script to work.

(* usually shift and the \ key on UK keyboards)

Tommy

10:09 am on Feb 6, 2002 (gmt 0)

10+ Year Member



Jepp, have change to the right symbol, now its working !