473,320 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1253
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: lawrence | last post by:
This PHP function prints out a bunch of Javascript (as you can see). This is all part of the open source weblog software of PDS (www.publicdomainsoftware.org). We had this javascript stuff...
12
by: lawrence | last post by:
The following function correctly makes everything invisible but then fails to turn the one chosen DIV back to visible. I imagine I'm getting the syntax of the variable wrong? I've tried this with...
4
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) {...
7
by: PaulB | last post by:
Good Morning everybody, I'm trying to adapt a tutorial script that will handle the behaviour of an "Expanding/Contracting" site-navigation menu. The code that seems to handle the expansion and...
3
by: davidkarlsson74 | last post by:
Error: document.getElementById("folderMenu").cells has no properties File: http://www.volkswagen.se/tillbehor/js/foldermenu.js Rad: 49 The function activates different DIV:s, but doesn't seem to...
1
by: Andre Ranieri | last post by:
Hello, I'm trying to set up an ASP.NET 2.0 form where the user enters values in WebControls.TextBoxes for amount owing, interest and late fees and a JavaScript function totals the three values...
6
by: therig | last post by:
I'm having issues, I've spent many hours searching and I'm a noob at javascript, any help will be greatly appreciated. I keep getting the following error: Error: document.forms.sec11_A has no...
4
by: dr1ft3r | last post by:
Hey guys, I'm building a site for a landscaping business down the street and can't seem to get part of the code functioning correctly. The code fails on line 68 where I make a reference to an...
13
by: RommelTJ | last post by:
Hi, My website (http://www.justiceinmexico.org/indextest.php) looks good in Firefox, but horrible in IE, and I think it's because of an error in the javascript of a free web ticker I got off the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.