RESOLVED DUPLICATE of bug 6006 15127
getElementById enhancement request
https://bugs.webkit.org/show_bug.cgi?id=15127
Summary getElementById enhancement request
jason hu
Reported 2007-08-31 21:20:28 PDT
getElementById function retrieves element by the "id" attribute, but IE browser also checks "name" attribute too if the "id" doesn't exist. I noticed many web pages were code in the way, it calls "getElementById" and only "name" attribute exist for the element, so can you add this simple check if the "id" exist, use "id", otherwise use "name"? thanks
Attachments
Alexey Proskuryakov
Comment 1 2007-09-01 00:36:55 PDT
Could you please give examples of real sites coded this way?
mitz
Comment 2 2007-09-01 00:57:53 PDT
(In reply to comment #1) > Could you please give examples of real sites coded this way? The customer service section of the Israeli Orange franchise, <https://direct.orange.co.il/selfservice/>.
jason hu
Comment 3 2007-09-01 06:39:06 PDT
the reason why some sites are coded this way is because of some Web Framwork, such as "Struts" doesn't generate "id" attribute by default, but it generates "name" attribute all the time, and getElementById works fine in IE even without "id" attribute, some lazy developers don't even bother to go back fix this. Struts was so popular, I saw this problem since begining.
Alexey Proskuryakov
Comment 4 2007-10-05 04:35:34 PDT
Opera is apparently going to remove this quirk from their 9.50 release: "Removed IE-compatibility where Document.getElementById treated name and id attributes the same, which caused problems with jQuery." Still, this is a compatibility issue that we should consider fixing.
Alexey Proskuryakov
Comment 5 2007-11-07 13:03:10 PST
*** This bug has been marked as a duplicate of 6006 ***
Note You need to log in before you can comment on or make changes to this bug.