Browser Compatibility!!

They have: 2 posts

Joined: Aug 2003

Can anyone help me out with this problem I have.....

I'm designing a website for a rather large company and I'm almost done. It works beautifully on both Netscape and Internet Explorer browsers. However I was asked to make it work in Mozilla as well. It seems that I only have a problem with my drop down menu.

Hopefully someone can help me out with this. If more info is needed I'll supply it. I'll also put the latest version of the site online at http://www.htowndesigns.com/FMF/

Thanks!!

-Jeremy

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

First guess: you're using IE-specific DOM. That is document.all.Home... What you want for Moz is document.getElementById("Home")...

So change

function start() {
document.all.Home.style.height='29px';
document.all.Brokers.style.height='29px';
// etc
}
'
to
<?php
function start() {
document.getElementById(\"Home\").style.height='29px';
document.getElementById(\"Brokers\").style.height='29px';
// etc
}
?>

and

function bigBrokers(lyr) {
document.all[lyr].style.height='145px'; }
'
to
<?php
function bigBrokers(lyr) {
document.getElementById(lyr).style.height='145px'; }
?>

and so on. Smiling

I can't recall how well getElementById is supported by IE, so you may have to add a browser check and use both methods. Try this anyway...

They have: 2 posts

Joined: Aug 2003

Abhishek Reddy thanks for your help!! I'll give this a shot and see how it works in IE. If that doesn't work I'll just throw in a page that checks what browser they're using and then redirects them. Thanks again!!

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

It works pretty well in IE

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Well that's to be expected, eh Renegade, since Mozilla is not IE? Wink

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

no, I'm talking the GetElementByID thing, it works pretty well in IE

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Ah! That makes more sense! *doh!*

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

I've tested a copy of your page with the changes I proposed and it seems to work just fine in Mozilla Firebird, IE6 and IE5. Smiling

btw, afaik, getElementById() is not as well supported in IE. I tend to work with it on a practical basis -- try it, if it works, go with it; nevermind any other rules of thumb. Smiling

edit:

Quote: From Apple Developer Connection- Dynamic Content with DOM-2 (Part I of II)

Microsoft faced a dilemma. On the one hand, developers for IE4 had already invested heavily in the IE4 style of referencing objects; on the other hand, Microsoft had participated in the W3C DOM effort and could not ignore it. The result, as implemented in IE5, is a hybrid model that maintains compatibility with the IE4 DOM and supports at least the basic way of referencing objects in the W3C DOM syntax. Redundant? Yes.

It's IE4 that wholly doesn't support getElementById, then. Shocked

edit 2:
According to this reference, Explorers 5 and 6 have a "Slight bug" with gEBId.

They have: 461 posts

Joined: Jul 2003

umm... people still use ie4? if you're under 5.5 it tells you you need to dl 5.5 or 6 to use windows update.

also, which netscape? 4.xx has end of life
6.x is not on the mozilla engine but gecko and had all sorts of quirks that...
7.x has the mozilla engine.. that's right. driven fromt eh same thing as mozilla, only morphed by aol in ways i don't care for, so they generally react the same way. firebird is a dev version. i have 1.31 to test how people see it (and it's what i use whenon the linux box i have)

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Some old boxes still have IE4. Netscape 4 is a little more popular. Either way, no point coding for them. I was merely pointing out that gEBId functionality is not necessarily complete in IEx -- must find specifics on that. Smiling

The Gecko/Moz engine may be essentially the same, but Netscape has a higher tolerance for MS and non-standard code, such as document.all, so testing on NS is not a good idea -- better to test with a "pure" Gecko/Moz first. Smiling

They have: 461 posts

Joined: Jul 2003

i thought there was some issues with gecko so they went back to the mozilla engine that is used by mozilla. i know they changed or had a major changein the engine between 6.x and 7.x so they will behave differntly

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.