Javascript: the browser Object Model (BOM)

Source: Internet
Author: User
Window
  • The window object is a browser or framework itself. Top is always a browser, parent is a parent framework, and Self represents itself.
    Windows can be omitted.
  • Window operation: moveBy (dx, Dy), moveTo (x, y ),
    ResizeBy (DW, DH), resizeTo (W, H ).
  • Navigation: window. Open (URL, Frame
    Name, attribute). attribute can be left, top, height, width, resizable,
    Scrollable, toolbar, status, location (all default no ).

    • Window. Open
      A new window reference is returned, and an opener object indicates the parent window.
    • Window. Close.
  • Dialog Box:
    Alert, confirm, prompt.
  • Status Bar: window. Status, window. defaultstatus
  • Hour
    Interval and pause: timeoutid = setTimeout ("alert ('Hello World')", 1000 );
    Cleartimeout (timeoutid); similar to setinterval and clearinterval.
  • History:
    Window. History. Go (+-N), history. Back, history. Forward. History. Length

Document
  • Alert(registry.doc ument
    = Document) = true. It is the only object that belongs to both Dom and BOM.
  • Attribute: title, URL,
    Referrer, lastmodified
  • Set attributes: anchors, applets, embeds, forms,
    Images, links.
  • Method: Write, writeln.
    The write () and writeln () methods must be called before the page is fully loaded. If any method is called after the page is loaded, it will erase the page content and display the specified content.

Location
  • Window and
    Document attributes are equivalent to each other.
  • Attribute: Hash (something behind #), host, hostname, href,
    Pathname, port, protocol, search (located in? ).
  • Method: Assign (),
    Replace (), reload (false = import from cache (default), true = import from server)

Navigator and
Screen Object
  • The navigator object represents the browser itself and can obtain some attributes, but each browser supports different attributes.
  • Screen
    You can obtain the user system information, such as availheight, availwidth (available screen width and height, excluding the system taskbar), colordepth,
    Height, width.

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.