How come my page works in Firefox but not in I E?

K

kaeli

What there should be is nice scroll buttons on the top right hand corner
of the page.

Works fine with firefox, but not with I.E.

http://wintergreen.eternalnetworks.com/links.html

No doctype. That throws browsers into quirks mode. Probably not what you
really want.

That said,
STOP BROWSER DETECTION. See the 16 thousand other threads in the archives
about how that tends to muck things up.

From your source:
function verifyCompatibleBrowser(){
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
}

Considering that's in there, you're in quirks mode, and your html isn't
valid, you ought to go fix all that before you worry about the rest of the
script.

--
 
L

Lee

Dfenestr8 said:
What there should be is nice scroll buttons on the top right hand corner
of the page.

Works fine with firefox, but not with I.E.

http://wintergreen.eternalnetworks.com/links.html

The author seems to have decided that it should not work with
any version of IE except 4 or 5:

function verifyCompatibleBrowser(){
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
}
 
D

Dfenestr8

Dfenestr8 said:
The author seems to have decided that it should not work with any version
of IE except 4 or 5:

function verifyCompatibleBrowser(){
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
}
}

Can you hand feed me an alteration to the subroutine to fix that?
 
F

Fred Oz

Dfenestr8 said:
Can you hand feed me an alteration to the subroutine to fix that?

Presuming browser detection is needed at all (and it isn't),
no change is required. IE 6 will be identified as "dom", which
probably just as suitable as any other classification you may
want to give it.

Incidentally:

this.dom = document.getElementById ? 1 : 0;

Could be more simply written as:

this.dom = document.getElementById;

If document.getElementById is undefined, the so will this.dom
and any test of it will return false. Vice versa if the
original test is true (goes for all the global variables you
have initialised the same way).

Please read up on feature detection, it is much simpler and
cleaner and makes no assumptions about the user agent based on
support for a single feature.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top