Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <1938517.aqSPkdTlGX@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sat, 25 Feb 2012 13:12:26 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: Cant use <4f481090$0$4322$a8266bb1@newsreader.readnews.com> <2271012.FRqVoOGUtd@PointedEars.de> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 55 NNTP-Posting-Date: 25 Feb 2012 13:12:27 CET NNTP-Posting-Host: c367845e.newsspool3.arcor-online.net X-Trace: DXC=\[3i:ElofJEM1O2SEVCd X-Complaints-To: usenet-abuse@arcor.de Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:12161 Cal Who wrote: > > > >> However, the proper way to refer to the value of the control is >> >> document.forms["ScrabbleStopWatch"].elements["timeTotal"].value > > Does this work in IE and Firefox? It works in any scriptable browser as it originates from JavaScript 1.0 in Netscape Navigator 2.0 (which later was moved from the programming language to the Gecko DOM API, whereas Firefox is powered by Gecko) and the MSHTML DOM API in Internet Explorer 3.0, the so-called "DOM Level 0". > I've seen the getElementById used many times. Possible, but that has nothing to do with what I commented on. Which one could see had you quoted properly. There is also an extra leading space in your From header field value, which you might want to remove. Can one use your From header field value *unchanged* to contact you via e-mail? If not, you want to fix that as well. > Is this the old way No, it is part of "the new way", but it is often used in spite of better approaches, and too often in a program. The referencing I described above is both "old" ("DOM Level 0") and "new" (DOM Level 2 HTML, HTML5 Working Draft). > and what you show is now replacing it. No. > If so, why is the new way better? The use of collections is better than shortcut referencing because the former is *both* backwards-compatible *and* standardized, and there is less chance for ambiguity (consider formRef.action etc. -- form control or not?). Shortcut references are only backwards-compatible and probably compatible for now. They are neither specified by W3C DOM Level 2 HTML nor the most recent HTML5 Working Draft. PointedEars -- Use any version of Microsoft Frontpage to create your site. (This won't prevent people from viewing your source, but no one will want to steal it.) -- from (404-comp.)