JavaScript Tutorial/Document/Introduction

Материал из Web эксперт
Перейти к: навигация, поиск

Associative object arrays of document

   <source lang="javascript">

<HTML> <HEAD>

  <TITLE>Associative object arrays</TITLE>

<SCRIPT> function showProperties (theObject){

  for (var i in theObject) {
     if (theObject[i] != null) {
         document.write(i + " : " + theObject[i] + "
"); } else { document.write(i + "
"); } } return;

} </SCRIPT> </HEAD> <BODY> <SCRIPT> showProperties(window.document); </SCRIPT> </HTML></source>


Document

The Document object represents a Web page that is displayed in a browser window, frame, or layer.

An instance is created with each document that is loaded by the browser.

Properties, Methods, and Event Handlers Associated with the Document Object are listed in the following table.

alinkColor Color of activated link all Array of all HTML tags in the document anchors Array of Anchor objects applets Array of Applet objects bgcolor Background color of document classes Style sheet classes array cookie Cookie associated with document domain Domain of document embeds Array of embedded objects fgcolor Color of text in document forms Array of Form objects ids Style sheet IDs array images Array of Image objects lastModified Date when document was last modified layers Array of Layer objects linkColor Color of links links Array of Link objects plugins Array of embedded objects referrer URL of document to which the current document was linked tags Style sheet tag array title Title of document URL URL of current document vlinkColor Color of visited links captureEvents() Captures events to be handled by document close() Closes output stream to document getSelection() Returns the selected text open() Opens output stream to document releaseEvents() Releases events captured by document routeEvent() Routes captured events to other objects write() Appends text to document writeln() Appends text and a newline character to document onClick Handler for click events onDblClick Handler for double-click events onKeyDown Handler for KeyDown events onKeyPress Handler for KeyPress events onKeyUp Handler for KeyUp events onLoad Handler that is used when Document has finished loading onMouseDown Handler for MouseDown events onMouseUp Handler for MouseUp events onUnLoad Handler that is used when Document unloaded from window