Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #18285
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail |
|---|---|
| Content-Type | text/plain; charset="UTF-8" |
| Message-ID | <1388733.rf3QE0b1RE@PointedEars.de> (permalink) |
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Reply-To | Thomas 'PointedEars' Lahn <usenet@PointedEars.de> |
| Organization | PointedEars Software (PES) |
| Date | Mon, 28 Jan 2013 23:40:14 +0100 |
| User-Agent | KNode/4.8.5 |
| Content-Transfer-Encoding | 8Bit |
| X-Face | %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== |
| Subject | Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) |
| Newsgroups | comp.lang.javascript |
| References | <51031c8a$0$289$14726298@news.sunsite.dk> <q7VcV3KhTYBRFwQv@invalid.uk.co.demon.merlyn.invalid> <BqidnVGAKqG4xJvMnZ2dnUVZ_vWdnZ2d@westnet.com.au> <XnsA156A595A1093eejj99@194.109.133.133> <Jd2dnRnQztPfcpvMnZ2dnUVZ_sadnZ2d@westnet.com.au> |
| MIME-Version | 1.0 |
| Lines | 49 |
| NNTP-Posting-Date | 28 Jan 2013 23:40:14 CET |
| NNTP-Posting-Host | ea3e698a.newsspool4.arcor-online.net |
| X-Trace | DXC=oIcm[7mLLCY@@RW1FjIB5S4IUK<Cl32<Q4Fo<]lROoRQ8kF<OcfhCO[Lf0HJ8I\J]^DZm8W4\YJN\b@mF9jNikdU3>YBYU3JEo]57oHE_97ljW |
| X-Complaints-To | usenet-abuse@arcor.de |
| Xref | csiph.com comp.lang.javascript:18285 |
Show key headers only | View raw
Andrew Poulos wrote: > On 29/01/2013 2:16 AM, Evertjan. wrote: >> Andrew Poulos wrote on 28 jan 2013 in comp.lang.javascript: >>> On 28/01/2013 6:49 AM, Dr J R Stockton wrote: >>>> FAQ server posted: >>>>> An element can only be accessed after it exists in the document. >>>> False. An element cannot be accessed after it exists; it can only be >>>> accessed while it exists. >>> And how have you defined "exists". Surely an element "exists" in the >>> HTML even if the browser has not yet parsed the relevant HTML? >> HTML is just a string of text, the only elements being character numbers. > > Are saying that when some agent parses some HTML then and only then has > the document come into existence? Hence an element can't exist until the > document does? (For lack of another thread in this newsgroup, I am posting in this one …) This whole “discussion” is ridiculous. First of all, you cannot access an element at all. You can access an element *object* that *represents* an element in the document tree, and reflects the element's content attributes with shorthand properties, using an implementation of a DOM API. There cannot exist such an object in the way that it is accessible by code 1. before the corresponding element has been parsed 2. after the element node has been removed from the document tree, and there are no more references to said object stored in properties accessible by the code. It is not exactly news around here that it is only *safe* to access an element object for an element in the document when that document has been loaded; that is, all its elements have been parsed. This typically is the case when or after the document's “load” event occurs; the former can be handled in a backwards-compatible and – dare I say it? – cross-browser way using the “onload” attribute of the “body” element. Some DOM implementations, particularly those that support the HTML5 API, also support the more specific “DOMContentLoaded” event for which there is no content attribute (yet). <http://www.w3.org/TR/2012/CR-html5-20121217/syntax.html#the-end> -- PointedEars Twitter: @PointedEars2 Please do not Cc: me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
FAQ Topic - Why does my code fail to access an element? (2013-01-26) "FAQ server" <javascript@dotinternet.be> - 2013-01-26 00:00 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-01-27 19:49 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-28 01:32 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Richard Yates <richard@yatesguitar.com> - 2013-01-27 19:16 -0800
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-28 11:58 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-01-29 23:12 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Gene Wirchenko <genew@telus.net> - 2013-01-29 16:45 -0800
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Andrew Poulos <ap_prog@hotmail.com> - 2013-01-30 14:38 +1100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-30 09:52 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-30 09:31 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Andrew Poulos <ap_prog@hotmail.com> - 2013-01-28 21:55 +1100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-28 16:16 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Andrew Poulos <ap_prog@hotmail.com> - 2013-01-29 08:35 +1100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-28 23:40 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-29 00:21 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-01-29 00:53 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-29 21:24 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) John G Harris <niam@jghnorth.org.uk.invalid> - 2013-01-30 14:31 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-30 20:22 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) John G Harris <niam@jghnorth.org.uk.invalid> - 2013-01-31 10:55 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-31 22:42 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) John G Harris <niam@jghnorth.org.uk.invalid> - 2013-02-01 10:55 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-01 16:03 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-01-30 15:09 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-01-29 00:03 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) John G Harris <niam@jghnorth.org.invalid> - 2013-01-29 10:10 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-01-30 15:14 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) John G Harris <niam@jghnorth.org.uk.invalid> - 2013-01-31 10:50 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-02-01 23:29 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) John G Harris <niam@jghnorth.org.uk.invalid> - 2013-02-02 11:10 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-02-03 19:39 +0000
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Christoph Becker <cmbecker69@gmx.de> - 2013-02-04 01:56 +0100
Re: FAQ Topic - Why does my code fail to access an element? (2013-01-26) Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-02-06 16:08 +0000
csiph-web