View Full Version : NS/IE Dropdown - Help making it FireFox compatible

09-08-2006, 10:49 AM
Hi, I have a script programmed by a buddy of mine, and truth be told I dont know a lot about JS, this dropdown menu only works for IE/NS, as it was programmed that way. However, I believe use of the getElementById function(statement?) should allow for compatability between the 3 browsers, however I am not sure how to go about implementing it (My buddy never commented his code) normally, I would just make a new one, but the people using this script just want it edited

This is the URL to the page containing the script(It is just an html copy of the original ignore the rest other than the menu):


Any help would be appreciated,and if anyone needs clarification, feel free to ask

09-08-2006, 02:20 PM
It is always much difficult to debug/rebuild someone else's code than to build your own

Yes a crossbrowser code (for all the modern browsers) uses getElementById('id') instead of document.all[id_or_name] (old IE) and document.layers[id_or_name] (old NS4).

But you still need to detect Mozilla, as Moz uses NS's methods to capture the events. And all the values regarding the position must have measurement units (px usually).

My advice is to google for a similar but modern code, as to debug that will take you too much time.0

09-08-2006, 04:52 PM
Yes, I thank you for your suggestion, however the owner of the game will only accept an edited version of this script =/ and I spent a few hours trying to do it to no avail Perhaps someone else might be able to help me out, but once again, I thank you for your input :)

09-08-2006, 05:03 PM
Yes, I thank you for your suggestion, however the owner of the game will only accept an edited version of this script
that is weird and silly of than owner... It does not matter which script code is used, as long as the result is the same. javascript is a modular and dynamic language. The same result might be achieved in different ways.

09-08-2006, 05:08 PM
Yeah, i remade it in CSS and he said "Just edit that one with getElementById" Odd person, I know, but alas, there is no changing his mind

09-10-2006, 01:12 PM
I hate to sound like I'm mooching, but I was kinda hoping for a bit more of a response, possibly by other members with tips/suggestions on the code itself.

Dont get me wrong, I apprecciate whats been suggested already, and I understand your time is valuable, so If no one else has anymore suggestions, I have no complaints, and won't say anything else on this topic. No worries :D

Also, on a different note, I love these forums, a lot of interesting stuff to read, Suprised I didnt find it sooner, I'll be around for a while I think.

09-10-2006, 01:25 PM
You asked for something which does not exists. If we will modify the code to be crossbrowser, that new code will be another code. If it will be another code, the "owner" will not like it. As I said, it is not only a matter to use getElementById(), there are more other things to be changed there. If the owner does not understand that, than it means he does not know javascript. If he does not know javascript, then he should leave people who know javascript to do this job.

I don't know how other pople here might think, but I can not make this code to be cross-browser unles I would change it almost entirely. In fact I would have build an entirely new code. But your owner does not like that... So, what to do?

09-10-2006, 03:00 PM
You know what, you are entirely right, My apologies, If someone wanted to redesign that script for me, that would be great. If not i'm sure I could find and edit something for it, and if they have any problems, then they can deal with what they have, I'm sorry If I came across in any way negatively, also, I think I'm going to click that helpful users link in your signature, as you did help me and I appreciate it immensley