Forum Moderators: open
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.
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?
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.
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.
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
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.