Immediate closing of iterators

Brendan Eich brendan at mozilla.org
Fri Dec 15 13:42:14 PST 2006


On Dec 14, 2006, at 11:51 PM, Brendan Eich wrote:

> <textarea id="t" rows="4"></textarea>
> <script type="application/javascript;version=1.7">
> var tarea = document.getElementById('t');
> var print = function (s) { t.value += s + '\n'; }

Heh; this works, but careful readers may wonder why, since the print  
function uses t.value, not tarea.value. Turns out Firefox emulates an  
IE DOM quirk, only if the name lookup would fail, where elements  
given ids (or names? I forget) reflect as global properties.  Sick,  
but we found too many pages counting on it without detecting non-IE  
user agent.

/be




More information about the Es4-discuss mailing list