diff options
author | Thomas BrĂ¼derli | 2008-08-04 09:13:00 +0000 |
---|---|---|
committer | Thomas BrĂ¼derli | 2008-08-04 09:13:00 +0000 |
commit | 9d93a6860b5c7f43c5909072ef84847e580f003e (patch) | |
tree | bfa43f74595bab3b8a9e9cc9fb2558e326c83196 /itjs | |
parent | 02ea8d6332dd832fc96663da7eae27c849af53fb (diff) | |
download | itools-9d93a6860b5c7f43c5909072ef84847e580f003e.tar.gz itools-9d93a6860b5c7f43c5909072ef84847e580f003e.tar.bz2 itools-9d93a6860b5c7f43c5909072ef84847e580f003e.zip |
Move it_element() from map.search.ch to itools
Diffstat (limited to 'itjs')
-rw-r--r-- | itjs/it.js | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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) { |