go to  ForumEasy.com   
JavaPro  
 
 
   Home  |  MyForum  |  FAQ  |  Archive    You are not logged in. [Login] or [Register]  
Forum Home » JavaScript » Override IE4 legacy document.all()
Email To Friend  |   Set Alert To This Topic Rewarding Points Availabe: 0 (What's this) New Topic  |   Post Reply
Author Topic: Override IE4 legacy document.all()
WebSpider
member
offline   
 
posts: 147
joined: 06/29/2006
from: Seattle, WA
  posted on: 07/24/2006 09:42:39 PM    Edit  |   Quote  |   Report 
Override IE4 legacy document.all()
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
 Profile | Reply Points Earned: 0

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