- fix performance of getElementById wrapper for IE (don't look over all elements if initial getElementById returns no element

)
release-0.6
alecpl 15 years ago
parent 5d04a85924
commit 27480b4a02

@ -598,13 +598,14 @@ if (bw.ie)
document._getElementById = document.getElementById; document._getElementById = document.getElementById;
document.getElementById = function(id) document.getElementById = function(id)
{ {
var i = 0; var i = 0, obj = document._getElementById(id);
var o = document._getElementById(id);
if (!o || o.id != id) if (!obj || obj.id == id)
while ((o = document.all[i]) && o.id != id) return obj;
i++;
return o; while ((obj = document.all[i]) && obj.id != id)
i++;
return obj;
} }
}; };

Loading…
Cancel
Save