javascript手冊-l[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 longj 的 blog

propertyname is one of the properties listed below.

property of

  • document

    描述

    each link object is a location object and has the same properties as a location object.

    if a link object is also an anchor object, the object has entries in both the anchors and links arrays.

    when a user clicks a link object and navigates to the destination document (specified by href=locationorurl), the destination document's referrer property contains the url of the source document. evaluate the referrer property from the destination document.

    the links array

    you can reference the link objects in your code by using the links array. this array contains an entry for each link object (<a href=""> tag) in a document in source order. for example, if a document contains three link objects, these links are reflected as document.links[0], document.links[1], and document.links[2].

    to use the links array:

    1. document.links[index]
    2. document.links.length
    

    index is an integer representing a link in a document.

    to obtain the number of links in a document, use the length property: document.links.length.

    elements in the links array are read-only. for example, the statement document.links[0]="link1" has no effect.

    properties

    the link object has the following properties:

  • hash specifies an anchor name in the url
  • host specifies the hostname:port portion of the url
  • hostname specifies the host and domain name, or ip address, of a network host
  • href specifies the entire url
  • pathname specifies the url-path portion of the url
  • port specifies the communications port that the server uses for communications
  • protocol specifies the beginning of the url, including the colon
  • search specifies a query
  • target reflects the target attribute

    the links array has the following properties:

  • 本文关键:javascript
      相关方案
    Google
     

    本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

    go top