JavaScript BOM Rollup _javascript tips

Source: Internet
Author: User
Tags time interval

SetTimeout ()//timer, execute code only once

Cleartimeout ()//Clear Demo

SETINTERVLA ()//timer, execute code at specified time interval

Clearinterval ()//Clear Timer

Number of window.history.length//visited history pages

Window.history.forward ()//Previous page

Window.history.back (); Next page

Window.history.go (-1); Jump to a page that has been visited, negative value to jump backward

document.referrer//need to put two files on the server to get the desired results, if you get an empty string directly in the local folder, If you enter a b.html URL address directly in the browser's address bar or use the Open menu to access b.html, the Document.referrer value is an empty string.
Window.moveby//by is the relative meaning (from the original position)

Window.moveto//to is the absolute meaning (as a whole)

Window.moveto//Adjust the window size to the specified width and height.

Window.resizeby//Increase the window size or decrease the specified width and height

Window.screenleft/window.screenx//Distance to the left of the screen

Window.screentop/window.screeny//distance from top of screen


browser window Location:
IE, Chrome, Safari, Opera all provide support for window.screenleft and Window.screentop, but Firxfox does not support the two attributes;
Firxfox, Chrome, Safari, Opera all provide support for Window.screenx and Window.screeny, but IE does not support the two attributes;

Document.body.offsetheight/document.body.clientheight//Content height (body height)
Window.innerheight//chorm under Use
Document.documentElement.clientHeught//browser's visual height
Document.documentElement.scrollHeight//Content height (height of HTML)
Height of document.documentElement.scrollTop//scroll bar scrolling a new window
Window.close//Close window
Window.defaultstatus/window. Status/status bar information
Note: Window.status gets the temporary value given by the script. Window.defaultstatus gets the default value.

Document.lastmodified//Returns the last time the document was modified
Document.referrer//Return URL of previous location in browser history
Document.title//Returns the text displayed within the title tag in the current page
Document. URL//Return URL of current page
document.anchors[0].innerhtml//The contents of the first anchor point within the page
Location.reload (FALSE)//This method forces the browser to refresh the current page
Navigator.appcodename//stating the code name of the browser
Navigator.appvirson//Returns the platform and version information of the browser. The property is a read-only string
Eval//Can process a section of JS code represented by a string

The above mentioned is the entire content of this article, I hope you can enjoy.

Related Article

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: 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.