Javascript Notes and Summary (2-5) Window object

Source: Internet
Author: User

The browser Window object (BOM) is the browser host object, regardless of the JS language.

"Method for Window object"

Window.alert (message); window.confirm (message); Window.prompt (Message[,defaultstr]); Window.close (); Close window Window.print (); Print window.setintval (expression, MS) Window.clearintval (Timer object) window.settimeout (expression, MS) Window.cleartimeout (timer object)

Child object of Window object

▲navigator Browser Information Object    appcodename internal code    appName browser name    appversion Browser version    platform operating system type    UserAgent User agent Information    cookieenabled support cookie▲location Address bar object host    host    port port    href address    pathname Path    Protocol Protocol    Search query string    assign (URL) page Jump ▲history history    number of length history back    ();    Foeward ();    Go (); ▲screen Screen Object height    height width    width    availheight available height                     availwidth available width            document HTML Document Object is the object that HTML code forms, can change the content of the page dynamically

"Example" Navigator object

<script>Console.log (window.navigator); </script>

Output:

"Example" Location object

<script>Console.log (window.location); </script>

Output:

Search represents parameters, such as? id=3

Jump:

window.location.href = ' *******.html '

"Example" Document Object (DOM object, Sub-object of Window object)

<script>Console.log (window.document); </script>

Output:

Javascript Notes and Summary (2-5) Window object

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