go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Override IE4 legacy document.all()
 
Subject: Override IE4 legacy document.all()
Author: WebSpider
Posted on: 07/24/2006 09:42:39 PM

Since IE5, document.getElementById() is introduced to replace document.all(), in order to comply with W3c consortium's DOM. What happens if clients, like our grandmas, are still using the older version IE4? Here is the solution:

<script language="JavaScript">
if(!document.getElementById && document.all) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}

</script>


By adding the above into your DOM handling script, you can just simply ignore the document.all() legacy problem.

For example,

http://www.forumeasy.com/forums/thread.jsp?tid=115378086669&fid=javaprof25



References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.