Javascript BOM summarization _ javascript skills

Source: Internet
Author: User
This article summarizes some methods related to the BOM of javascript. For more information, see. SetTimeout () // latency, only one Code Execution

ClearTimeout () // clear the presenter

SetIntervla () // timer, which executes the code once according to the specified time interval

ClearInterval () // clear the timer

Window. history. length // number of historical pages accessed

Window. history. forward () // Previous Page

Window. history. back (); // next page

Window. history. go (-1); // jump to a previously visited page. A negative value indicates backward hop.

Document. referrer // empty, the value of document. referrer is an empty string.
Window. moveBy // by indicates relative meaning (from the original position)

Window. moveTo // to is the absolute meaning (from the whole)

Window. moveTo // adjust the window size to the specified width and height.

Window. resizeBy // increase or decrease the window size by the specified width and height.

Window. screenLeft/window. screenX // distance from the left side of the screen

Window. screenTop/window. screenY // distance from the screen top

Note:

Browser window location:
IE, Chrome, Safari, and Opera all support window. screenLeft and window. screenTop, but Firxfox does not support these two attributes;
Firxfox, Chrome, Safari, and Opera all provide support for window. screenX and window. screenY, but IE does not support these two attributes;

Document. body. offsetHeight/document. body. clientHeight // content height (body height)
Window. innerHeight // used in Chorm
Document.doc umentElement. clientHeught // visible height of the browser
Document.doc umentElement. scrollHeight // content height (HTML height)
Document.doc umentElement. scrollTop // height of the scroll bar

Window. open // open a new window
Window. close // close the window
Window. defaultStatus/window. Status // Status bar Information
Note: window. status obtains the temporary value assigned by the script. Window. defaultStatus gets the default value.

Document. lastModified // return the last modification time of the document
Document. referrer // return the URL of the previous position in the browser history
Document. title // return the text displayed in the title tab of the current page.
Document. URL // return the URL of the current page
Document. anchors [0]. innerHTML // content of the first anchors on the page
Location. reload (false) // This method forces the browser to refresh the current page
Navigator. appCodeName // declare the browser code name
Navigator. appVirson // return the platform and version information of the browser. This attribute is a read-only string
Eval // can process a piece of JS Code represented by a string
EncodeURI // Encoding
DecodeURI // decode

The above is all the content of this article. I hope you will like it.

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.