faqts : Computers : Programming : Languages : JavaScript : Links

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 10 people (80%) answered Yes
Recently 4 of 6 people (67%) answered Yes


Does Link object have a 'name' property or an 'id' ?

Oct 30th, 2008 17:22
games games, Colin Fraser, sharon, Client Reference JS13.pdf

No. This summary and example comes from the Client Reference JS13.pdf 
file from Netscape's developer site. (The URL is sometihng like 
developer.netscape.com/documentation or somesuch I lost it and have 
too lazy to go and get it again.)
Property Summary
Property 		Description
hash 			Specifies an anchor name in the URL.
host 			Specifies the host and domain name, 
				or IP address, of a network host.
hostname 		Specifies the host:port portion of the 
href 			Specifies the entire URL.
pathname 		Specifies the URL-path portion of 
				the URL.
port 			Specifies the communications port 
				that the server uses.
protocol 		Specifies the beginning of the URL, 
				including the colon.
search 			Specifies a query string.
target 			Reflects the TARGET attribute.
text 			A string containing the content of 
				the corresponding A tag.
x 			The horizontal position of the link’s 
			left edge, in pixels, relative to the left 
			edge of the document.
y 			The vertical position of the link’s top 
			edge, in pixels, relative to the top edge 
			of the document.
Method Summary
Method 			Description
handleEvent 		Invokes the handler for the specified event.
Example 5: links array. In the following example, the linkGetter 
function uses the links array to display the value of each link in the 
current document. The example also defines several links and a button 
for running linkGetter.
function linkGetter() {
  msgWindow.document.write("links.length is " +
  document.links.length + "<BR>")
  for(var i =0;i <document.links.length; i++) {
     msgWindow.document.write(document.links[i] + "<BR>")
<A HREF="http://home.netscape.com">Netscape Home Page</A>
<A HREF="http://www.catalog.com/fwcfc/">China Adoptions</A>
<A HREF="http://www.supernet.net/~dugbrown/">Bad Dog Chronicles</A>
<A HREF="http://www.best.com/~doghouse/homecnt.shtml">Lab Rescue</A>
<INPUT TYPE="button" VALUE="Display links"
Hope this helps.