JavaScript Browser object Model (BOM)

Source: Internet
Author: User

1 Window Object

It is an interface that accesses the browser window via JS, and is also the global object specified by ECMAScript.

1.1 Global scope

Global variables cannot be deleted through delete, but the properties defined directly on the Window object can be

var == "Red"; delete window.age;   // throws an error while ie<9, and returns false in other browsers Delete // throws an error when ie<9, returns true in other browsers alert (window.age);    //  in // undefined

Because the Window property added with the VAR statement has an attribute named [[Configurable]], the reference to this attribute is set to false, so it cannot be deleted through delete.

* Attempting to access an undeclared variable throws an error, but through window you can query whether a variable exists

1.2 Window relationships and frames (never used, usually with jquery or other frameworks)

1.3 Window Position (IBID.)

1.4 Window Size (IBID.)

1.5 Navigating and opening windows

window.open ()-Four parameters: the URL to load, the window target, an attribute string, and a Boolean value that indicates whether the new page supersedes the page currently loaded by the browser.

* Handling when blocked

var false ; Try {    var wroxwin = window.open ("", "_blank");     if NULL ) {        true;    }} Catch (ex) {    true;} if (blocked) {    alert ("The Popup was blocked!" );}

1.6 Intermittent calls and timeout calls

It is not recommended to use a string as the first argument

The second parameter is defined by telling JS how long it takes to add the current task to the queue instead of executing it.

* In strict mode, this is undefined.

1.7 System dialog box (alert, confirm, prompt)

2 Location Object

Provides information about the documents loaded in the current window, as well as some navigational features. Window.location and Document.location refer to the same object.

2.1 Query string parameters

2.2 Position operation

3 Navigator Objects

3.1 Detection Plug-in

3.2 Processing the registration procedure

4 Screen Object

5. History Object

// back one page history.go ( -1); History.back (); // forward one page history.go (1); History.forward (); // jump to the nearest wrox.com page history.go ("wrox.com")

JavaScript Browser object Model (BOM)

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.