Welcome to WebmasterWorld Guest from 54.159.246.164

Forum Moderators: incrediBILL

Message Too Old, No Replies

Firefox - javascript menu compatibility nightmare

Redesign half dozen menus for FF compatibility?

   
5:44 pm on Dec 20, 2005 (gmt 0)

10+ Year Member



I've recently noticed that most of my clients java menus do not work properly in FF. Are we going to see more of the " This website best viewed with IE5 or later" , or are a lot of designers having to go through redesigning menus becasue FF doesnt seem to be as java compatible as it could?
I've been telling my clients its still a new browser and these were done before it was popular.
Any feedback or advice would be greatly appreciated.
5:52 pm on Dec 20, 2005 (gmt 0)

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I've recently noticed that most of my clients java menus do not work properly in FF.

Is it the JavaScript or is it the html that is causing issues? It is most likely the html that will need to be brought up to standards for it to display properly. And then, there are a certain percentage of those JavaScript menus that only work in IE.

6:23 pm on Dec 20, 2005 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Assuming the html validates, one of the commonest javascript compatibility issues seems to be not using document.getElementById because you can get away without it in IE - but it's usually an easy fix.

Kaled.

6:42 pm on Dec 20, 2005 (gmt 0)

10+ Year Member



Thanks for the advice, guess i'll have to check the html for validation and try again.

Took a quick look at 2 scripts both have the get elementbyid attribute but only one has this...

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers

Is there a snippet i could add that instucts for FF?

8:26 pm on Dec 20, 2005 (gmt 0)

5+ Year Member



Aside from the aforementioned good suggestions...

Did you check their FF versions? In my mind, Firefox is startlingly bad(or just extremely strict; I'm not enough of an expert on JS to know which) with Javascript... I've had quite a few JS menus and other functions that work in EVERY SINGLE browser besides FF... but with the recent release of 1.5, I've noticed that many of those issues have gone away (which is what leads me to believe that FF is bad with JS, rather than righteously strict).

Now obviously you still have to account for the many people who use older versions... but I would check out your problem scripts in the FF 1.5 release: if they work fine, then you simply have a moral dilemma over whether or not you should to make changes to accommodate outdated browsers.

11:20 pm on Dec 20, 2005 (gmt 0)

10+ Year Member



Thanks Don, I've got version1 with all the updates.
Guess i have to uninstall then download the new one.
I also found so many validation errors that i'll be busy for a while anyways.
Thanks!
11:59 pm on Dec 20, 2005 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You should also validate the CSS. For instance IE accepts '=' instead of ':' - I discovered that the hard way!

Kaled.

1:02 am on Dec 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Two more hints that are always relevant to this sort of thing:

Remember to provide alternative navigation for those users who have JavaScript switched off. This will help many people using all different kinds of browser.

It's easier to develop using FireFox as your test browser and then debug for IE, rather than do it the other way round. This is because FireFox complies more closely with the standards.

2:50 am on Dec 23, 2005 (gmt 0)

10+ Year Member



You should also validate the CSS. For instance IE accepts '=' instead of ':' - I discovered that the hard way!

Thanks, a bit embarrasing I guess, never even occured to me the css and the html both need to validate. Ive somewhat hacked my way through coding html.

It's easier to develop using FireFox as your test browser and then debug for IE, rather than do it the other way round. This is because FireFox complies more closely with the standards.

Thanks, I'll be trying that.

Kaled,did you mean i might try something like this?

var FF1.0=document.getElementById&&!document.all
var FF1.5=document.getElementById&&!document.all

3:17 am on Dec 23, 2005 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I use document.getElementById() exclusively. Having said that, I don't test on ancient browsers so if you're required to support IE 4, for instance, then you'll need to verify compatibility.

If necessary, create a function thus


function getElement(id)
{ if (document.getElementById) return document.getElementById(id)
else return eval('document.all.' + id)
}

I think that's how it should work but, as I said, I don't use document.all

Kaled.

3:57 am on Dec 23, 2005 (gmt 0)

10+ Year Member



Thanks Kaled, I wish i could afford the time to learn javascript, just amazes me all the different things you can do with it. I hack my way through edititng it a bit but it must fell great to be able to compile menus,games, etc.