czwartek, października 20, 2005

DOM poziomu 0 zawie

DOM poziomu 0 – zawiera obiekty przeglądarki prezentujące : okno, biezący dokument oraz zawartość.
Window
The window object represents the current browser window. If multiple windows are open or frames are used, there may be more than one window object. These are given aliases to distinguish them:
  1. self represents the current window, as does window. This is the window containing the current JavaScript document.

  2. top is the window currently on top (active) on the screen.

  3. parent is the window that contains the current frame.

  4. The frames array contains the window object for each frame in a framed document.
The window object has three child objects:
  1. location stores the location (URL) of the document displayed in the window.

  2. document stores information about the current Web page.

  3. The history object contains a list of sites visited before or after the current site in the window.
Location
The location object contains information about the current URL being displayed by the window. It has a set of properties to hold the different components of the URL:
  1. location.hash is the name of an anchor within the document, if specified.

  2. location.host is a combination of the host name and port.

  3. location.hostname specifies the host name.

  4. location.href is the entire URL.

  5. location.pathname is the directory to find the document on the host, and the name of the file.

  6. location.port specifies the communication port.

  7. location.protocol is the protocol (or method) of the URL.

  8. location.query specifies a query string.

  9. location.target specifies the TARGET attribute of the link that was used to reach the current location.
History
The history object holds information about the URLs that have been visited before and after the current one in the window, and includes methods to go to previous or next locations:
  1. history.back goes back to the previous location.

  2. history.forward goes forward to the next location.

  3. history.go goes to a specified offset in the history list.
Document
The document object represents the current document in the window. It includes the following child objects:
  1. document.forms is a collection with an element for each form in the document.

  2. document.links is a collection containing elements for each of the links in the document.

  3. document.anchors is a collection with elements for each of the anchors in the document.

  4. document.images contains an element for each of the images in the current document.

  5. document.applets is a collection with references to each embedded Java applet in the document.
Navigator
The navigator object includes information about the current browser version:
  1. appCodeName is the browser's code name, usually "Mozilla."

  2. appName is the browser's full name.

  3. appVersion is the version number of the browser. (Example: "4.0(Win95;I)".)

  4. userAgent is the user-agent header, which is sent to the host when requesting a web page. It includes the entire version information, such as "Mozilla/4.5(Win95;I)."

  5. plugIns is a collection, which contains information about each currently-available plug-in (Netscape only).

  6. mimeTypes is a collection containing an element for each of the available MIME types (Netscape only).

Brak komentarzy: