Day02--widow Object

Source: Internet
Author: User

Window-Timer

1?settimeout () can be used to invoke a function one time after a specified time.

setTimeount(f,1000);//一秒后调用函数fclearTimeout();取消函数的执行

2. SetInterval () can be used to repeat the call function after the specified time.

setInterval(f,1000);//每1秒调用函数fclearInterval();取消函数的调用

window-location (positioning)

The Location Property object of the 1?window object, which represents the URL of the document currently displayed in the window, or it can be loaded into a new document.

The location of the 2?document object is the same as the location of the Window object.

3. Common Properties:

    • Location.href: Returns the URL of the current page
    • Location.hostname: Returns the domain name of the web host
    • Location.pathname: Returns the path and file name of the current page
    • Location.port back to Web: Host port
    • Location.protocol: Returns the Web protocol used (/HTTP///https://)
window-Browsing history

1. The History property of the Window object is used as a list of the browser's historical documents.

    • Window.history.length: Represents the number of elements in the browsing history table.
    • Window.history.back (): the same as the browser's Back button.
    • Window.history.forward (): Same as the "forward" button in the browser.
    • Window.history.go (): Accepts an integer parameter that can skip any number of pages forward (positive) or backward (negative arguments).
Window-navigator Object

1. We need to know that the current browser vendor and version information can be used with the Navigator object. It has several common properties.

    • AppName: The full name of the browser.
    • AppVersion: The version of the browser.
    • UserAgent: usually contains the string sent in the HTTP header, or it may contain other details.

2. You can also use non-normalized properties.

    • Online: Indicates whether the browser is currently connected to a network.
    • Gelocation: Properties for determining user geolocation information, HTML5
    • javaenabled (): Returns True when the browser runs a Java applet.
    • Cookieenable: Returns True when the browser can save the cookie.
window.navigator.appName

Day02--widow Object

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.