JavaScript Learning Notes (11) _ Basics

Source: Internet
Author: User

Document Object

The following table lists the Some common properties of the Document object for the BOM:

of the genus

say

Alinkcolor

activated link colors, such as <body alink= "COLOR" > definition of *

BgColor

the background color of the page, such as <body bgcolor= "COLOR" > definition of *

Fgcolor

The text color of the page, such as <body text= "COLOR" > definition of *

LastModified

Last modified page date, is a string

LinkColor

The color of the link, such as <body link= "COLOR" > definition of *

Referrer

in browser history, a position that is backward Url

Title

<title/> The text displayed in the label

Url

Of the currently loaded page. Url

Vlinkcolor

The colors of the links that have been visited, such as <body vlink= "COLOR" > definition *

* object to using these properties because they refer to the old HTML feature in the <body/> label . You should replace them with style sheet scripts.

The document object also has a number of collections that provide access to the various parts of the loaded page. The following table lists these collections:

set together

say

Anchors

The collection of all the anchors in the page

Applets

A collection of all applets in a page

Embeds

a collection of all embedded objects in the page (represented by the <embed/> label)

Forms

Collection of all forms in a page

Images

A collection of all the images in a page

Links

A collection of all the links in a page

Similar to the Window.frame collection, you can refer to each collection of the Document object with numbers or names, that is, available document.images[0] or document.images[" Picture's name"] to access the image.

Location objects

The Location object represents the URL of a loaded window, and it can also resolve URLs.

Hash-If the URL contains #, the method returns the content after the symbol (for example, the hash of Http://www.somewhere.com/index#selection1 equals "#selection1").

host-the name of the server (such as www.wrox.com).

hostname--usually equal to host, sometimes omitting the front of www.

href-the full URL of the currently loaded page.

Pathname The part of the host name in the --url. For example, Http://www.somewhere.com/pictures/index.htm's pathname is "/pictures/index.htm".

The port of the request declared in Port--url. By default, most URLs do not have port information, so this property is usually blank. URLs such as http://www.somewhere.com:8080/index.htm have a port property equal to 8080.

protocolThe protocol used in--url, the part before the double slash (//). For example, the Protocol property in http://www.somewhere.com equals the Protocol property of Http:,ftp://www.somewhere.com equals ftp:.

Search-The part of a question mark (?) in the URL that executes a GET request, also known as a query string. For example, the search property in Http://www.somewhere.com/abc.htm?term=javascript equals? term=javascript

jump to a page, but do not want to access from the browser history, that is, you can not back, use the method location.replace("http://www.baidu.com") method.

Navigator Objects

Detects the version of the browser , the MIME type supported, and the installed add-in (plug-in). The object contains two child objects: A Plug-in object, a MIME type object.

appCodeName

Code

AppName

Name

AppVersion

Version

Language

Language

MimeType

Represents a supported MIME type in an array

Platform

Machine type for compiling browsers

Plugins

To represent an installed add-in in an array

UserAgent

Table headers for user agents

Screen Object

The Screen object contains on-screen information, usually containing the following properties (however, many browsers have their own properties added):

Height-the height of the screen, measured in pixels.

Width-The breadth of the screen, measured in pixels.

availheight-the height (in pixels) of the screen the window can use, minus the width of the taskbar, changing with the user's taskbar and not changing with the window, including the space required for operating system elements such as the Windows toolbar.

availwidth-the width of the screen that the window can use (in pixels), minus the height of the taskbar, and changing with the user's taskbar.

colordepth-The color depth of the user's screen, measured in bits per pixel. is actually the number of digits representing the color. Most systems use 32-bit.

The availheight and Availwidth properties are useful when determining the size of a new window. For example, you can populate the user's screen with the following code:

MoveTo (0,0);

Resizeto (Screen.availwidth,screen,availheight);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.