【JavaScript】Bom

BOM

BOM (Browser Object Model) refers to the browser object model.
Provides a content-independent object structure for interacting with the browser window.
The Window object is the top-level object of the BOM, and other objects are sub-objects of this object.

Window object

The window object is the core of the BOM, and the window object refers to the current browser window.

Several dialog boxes

  • alert(message): alert dialog box
  • confirm(message): confirm the message dialog box, according to the user click "confirm" or "cancel", return true or false
  • prompt(text, value): A question dialog box, the parameter text indicates the prompt information, and the parameter value indicates the default value in the input box. Click OK to return what the user entered.

browser window control

  • window.name: Gets/sets the name of the window, mainly used to set targets for hyperlinks and forms

  • window.open(url, windowName, [WindowFeatures]): Open a window, only one window with the same name can be created.
    Three parameters can be passed:

    • url: the url of the newly opened window

    • windowName: Specify the name of the target attribute or window

      • _blank: URL loaded into a new window. this is the default

      • _parent: URL loading

Guess you like

Origin blog.csdn.net/Komorebi_00/article/details/131533387