getElementByID not working in Firefox but works in IE?
John Zwick
Ranch Hand
Joined: Mar 02, 2009
Posts: 34
posted
0
I am receiving the following error in the Error Console of Firefox however it works perfectly fine in IE 6:
"dropDownElement is null"
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
6
posted
0
I see a name, not an id.
id != name
Eric
Himanshu Kansal
Ranch Hand
Joined: Jul 05, 2009
Posts: 257
posted
0
Eric Pascarello wrote:I see a name, not an id.
id != name
Eric
As Eric said and just to point this out, line referred is Line 12. 'id' attribute should be added.
Experience and talent are independent of age
Himanshu Kansal
Ranch Hand
Joined: Jul 05, 2009
Posts: 257
posted
0
To add, that's not the only funny thing that happens in IE. IE does not follow the strict or transitional parsing of HTML. id can be replaced by name for IE. I am not sure if this is true for IE8 but till 7.x that's the case.
For testing the UI, safari or opera or firefox are good options, also now we have chrome.
John Zwick
Ranch Hand
Joined: Mar 02, 2009
Posts: 34
posted
0
Thanks for the fast replies everyone
I'm going to stop testing using IE once and for all!
John Zwick wrote:Thanks for the fast replies everyone
I'm going to stop testing using IE once and for all!
Noooooooooo!!! don't stop testing on it. but do use at least 1 of others.
I test on IE and Opera. We need to test only make sure the UI is consistent and to facilitate the end-user's experience.
Trilochan Bharadwaj
Ranch Hand
Joined: Feb 02, 2009
Posts: 100
posted
0
Himanshu, thats true, which is why I'd wanna repeat what Bear always pushes ... use external libs for some of the DOM and Event stuff, for example Dojo and other frameworks would always work in cross browser way, so you don't have to worry about it yourself and you can focus on the "job" at hand so as to speak.
BTW, on IE, I doubt if there is any organization that has completely abandoned IE testing, most of teams I have worked with test predominantly on IE, and all bugs related to js on Firefox et. al are marked minor (usually the case), but I am pretty sure it varies with organization, but generally one <b>should</b> test on IE. IE8 looks better than 7, but I haven't played with it completely, but there are differences on being non-standard(still ... things like Event bubbling), which stinks, I don't understand why Msft is so hell bent on being non-con formant.
I personally was in love with firebug and Firefox, but then i found Chrome ... it is just so fast (I don't have any benchmarks to back that up I am afraid, just personal experience with it), plus it has firebug kinda thing built into it, much better.
I develop on Firefox/Safari and test on IE. That way, the code follows the standards and only needs to deviate when it's absolutely necessary in order to work on the toy browser.