summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas BrĂ¼derli2008-08-04 09:13:00 +0000
committerThomas BrĂ¼derli2008-08-04 09:13:00 +0000
commit9d93a6860b5c7f43c5909072ef84847e580f003e (patch)
treebfa43f74595bab3b8a9e9cc9fb2558e326c83196
parent02ea8d6332dd832fc96663da7eae27c849af53fb (diff)
downloaditools-9d93a6860b5c7f43c5909072ef84847e580f003e.tar.gz
itools-9d93a6860b5c7f43c5909072ef84847e580f003e.tar.bz2
itools-9d93a6860b5c7f43c5909072ef84847e580f003e.zip
Move it_element() from map.search.ch to itools
-rw-r--r--itjs/it.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/itjs/it.js b/itjs/it.js
index aa8072f..9cc03ec 100644
--- a/itjs/it.js
+++ b/itjs/it.js
@@ -132,6 +132,25 @@ function it_get_obj_y(obj)
return curtop;
}
+/* Common accessor for dom elements */
+function it_find_obj(obj)
+{
+ if (document.getElementById)
+ return document.getElementById(obj);
+ else if (document.all)
+ return document.all[obj];
+ else if (document.layers)
+ return document.layers[obj];
+ return null;
+}
+
+/* Get dom element by ID but always return a valid object */
+function it_element(label)
+{
+ var tmp = it_find_obj(label);
+ return tmp ? tmp : {style:{}, src:""};
+}
+
/* Get an iframe's content document in a compatible way */
function it_get_iframe_document(iframe)
{