summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-09-12 17:31:23 +0000
committeralecpl <alec@alec.pl>2008-09-12 17:31:23 +0000
commitbafadd89d7c39e3c2d61a51b59176bc10165e119 (patch)
treec1de3bc5038d820997980611a07c31aee8024286 /program/js
parent620ca6644808ad4dd489e15e8d7a6e0417675a3e (diff)
- getElementById() case-sensitive hack for IE
Diffstat (limited to 'program/js')
-rw-r--r--program/js/common.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/program/js/common.js b/program/js/common.js
index 063657f89..649779746 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -631,3 +631,29 @@ RegExp.escape = function(str)
{
return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
}
+
+
+// Make getElementById() case-sensitive on IE
+if (bw.ie)
+ {
+ document._getElementById = document.getElementById;
+ document.getElementById = function(id)
+ {
+ var a = [];
+ var o = document._getElementById(id);
+
+ while (o.id != id)
+ {
+ a.push({i:o.id,e:o});
+ o.id = '';
+ o = document._getElementById(id);
+ if (!o) return o;
+ }
+
+ for (j=0,jj=a.length; j<jj; j++)
+ a[j].e.id = a[j].i;
+
+ a = null;
+ return o;
+ }
+ }