Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14412

Re: The links Collection

From Matt McDonald <matt@fortybelow.ca>
Newsgroups comp.lang.javascript
Subject Re: The links Collection
Date 2012-06-08 15:48 -0600
Organization A noiseless patient Spider
Message-ID <jqtrum$46i$1@dont-email.me> (permalink)
References <k5q4t7ld2khdqp1kb5pl71vto38u7l8hji@4ax.com>

Show all headers | View raw


On 12-06-08 03:11 PM, Gene Wirchenko wrote:
> [...] I am trying to understand how the links
> collection works.  Unfortunately, the book does not explain the
 > link collection in detail, and I have been unable to find
 > anything of help on the Web.

There's not a whole lot of detail required. What book are
you sourcing this code from?

> [...] refers to a particular link.  Its .innerHTML appears to
> be just a string so why would it have a .link property?  And
 > having specified which link at the start, why does it have to
 > be specified again for the .href?

You are reading a use of `String.prototype.link`[0], which is a
non-standard property. The CLJ FAQ coincidentally states[1]
the following.

 > Nonstandard built-in objects may include RuntimeObject,
 > **String.prototype.link**, CollectGarbage, and more.

> Does anyone have a pointer to a page that describes the links
> properties in detail?  All I have been able to find does not
> over any more than the first bit.

(assuming information about `HTMLDocument::links` is being
requested)

The DOM Level 2 HTML Specification states[2] the following.

 > A collection of all AREA elements and anchor (A) elements
 > in a document with a value for the href attribute.

As I wrote earlier, there's not a whole lot of detail
required.

[indentation removed and quotations trimmed]

[0]: https://developer.mozilla.org/en/JavaScript/
Reference/Global_Objects/String/link
[1]: http://www.fortybelow.ca/hosted/
comp-lang-javascript/faq/#builtInObject
[2]: http://www.w3.org/TR/DOM-Level-2-HTML/
html.html#ID-7068919

-- 
Matt McDonald: Web/Flash Developer; Edmonton, Alberta, Canada

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

The links Collection Gene Wirchenko <genew@ocis.net> - 2012-06-08 14:11 -0700
  Re: The links Collection Matt McDonald <matt@fortybelow.ca> - 2012-06-08 15:48 -0600
  Re: The links Collection SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2012-06-09 08:35 +0200
  Re: The links Collection Dr J R Stockton <J.R.Stockton@physics.org> - 2012-06-09 08:39 -0700
  Re: The links Collection Dr J R Stockton <J.R.Stockton@physics.org> - 2012-06-09 11:49 -0700
  Re: The links Collection Dr J R Stockton <reply1223@merlyn.demon.co.uk.not.invalid> - 2012-06-09 23:20 +0100

csiph-web