470,604 Members | 2,206 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,604 developers. It's quick & easy.

prototyping document.getElementById

It seems to me that document.getElementById and document.all are
essentially the same thing.

I'm thinking of prototyping document.getElementById for those browsers that
understand document.all but not document.getElementById (IE4).

Is that a reasonable thing to do? Suggestions?

Jeff


Jul 20 '05 #1
4 1135
Jeff Thies wrote:
It seems to me that document.getElementById and document.all are
essentially the same thing.

I'm thinking of prototyping document.getElementById for those browsers that
understand document.all but not document.getElementById (IE4).

Is that a reasonable thing to do? Suggestions?


It's easy and has been done before, but IE4 usage is much lower than
Mozilla and browsers with partial IE-DOM support. Furthermore, its CSS
support is so hopelessly antiquated, that you probably couldn't reliably
do things common in newer browsers.

Jul 20 '05 #2
In article <Xc******************@newsread3.news.atl.earthlink .net>, "Jeff
Thies" <no****@nospam.net> writes:
It seems to me that document.getElementById and document.all are
essentially the same thing.

I'm thinking of prototyping document.getElementById for those browsers that
understand document.all but not document.getElementById (IE4).

Is that a reasonable thing to do? Suggestions?


Last modified on 05-05-02
URL: http://www.metalusions.com/backstage/articles/8/
Does precisely what you are trying to do.
--
Randy
Jul 20 '05 #3
JRS: In article <20***************************@mb-m10.aol.com>, seen in
news:comp.lang.javascript, HikksNotAtHome <hi************@aol.com>
posted at Fri, 26 Dec 2003 23:42:47 :-
Last modified on 05-05-02


Please do not post dates like that; it could mean 5th May 2003, May 5th
2002, or 2005 May 2nd. In an international medium, one should follow
international standards, and use YYYY-MM-DD. Actually, that is IIRC in
ANSI X3.30-1985(R1991), FIPS PUB 4-1, 4-2.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 20 '05 #4
JRS: In article <Xc******************@newsread3.news.atl.earthlink .net>
, seen in news:comp.lang.javascript, Jeff Thies <no****@nospam.net>
posted at Fri, 26 Dec 2003 18:36:39 :-
It seems to me that document.getElementById and document.all are
essentially the same thing.

I'm thinking of prototyping document.getElementById for those browsers that
understand document.all but not document.getElementById (IE4).

Is that a reasonable thing to do? Suggestions?

Article
From: hi************@aol.com (HikksNotAtHome)
Newsgroups: comp.lang.javascript
Date: 24 Jun 2003 21:37:32 GMT
Subject: Re: Script Won't Upload in Netscape
Message-ID: <20***************************@mb-m15.aol.com>

included

if (document.all && !document.getElementById) {
document.getElementById = function(id) {
return document.all[id];
}
}

That looks worth a <FAQENTRY> to me; and I put it in my <URL:http://www.
merlyn.demon.co.uk/js-other.htm> as an example of Object Detection.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by PaulB | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.