Window Object BOM

Source: Internet
Author: User

BOM and new object is window, he represents an instance of the rover, as a global object, have access to parseint () and other methods

Variables declared in the global scope, functions have the money to access

            var a=;            function Sayname () {                console.log ("Name");            }            Console.log (window.a,a);            Window.sayname ();

Variables that have been defined globally cannot be deleted, but can be deleted in WINDOW.A definition

            var a=;            window.b=+;            Delete A;            Delete window.b;            Console.log (A, b);

Window relationships and Frames

window.frames[0,1,2,,,,]

Window.frames[name]

frames[0,1,2,,,]

Frames[name]

<frameset rows= "160,*" ><frame src= "frame.htm" name= "Topframe" ><frameset cols= "50%,50%" ><frame Src= "anotherframe.htm" name= "Leftframe" ><frame src= "yetanotherframe.htm" name= "RightFrame" ></frameset ></frameset>

Window position

Console.log (Window.screenleft,window.screentop,window.screenx,window.screeny);

Code for two mobile Windows (as if all were disabled

Window.moveto (A, B) Window.moveby (A, B)

Window position

Console.log (Window.innerwidth,window.outerwidth,window.innerwidth,window.outerwidth);

Adjust window size (Google and Firefox are banned

            Window.resizeto (100,100);            Window.resizeby (100,100);

Timeout call (suggested write function

var a=settimeout (function  () {                alert ("fuck");            },3000);

Intermittent calls

            var a=setinterval (function  () {                alert ("fuck");            },3000 );

System dialog box

Confirm (a) A is a representative asking you that sentence

            if (Confirm ("Fuck OK??") ) {                alert ("thx");            } Else {                alert ("Fuck You");            }

Prompt (A, b) A is a representative asking you, a representative for you to fill some, if you turn off or point no

            var a=prompt ("What ' s Your Name", "Ken");             if (a!==null) {                alert ("Welcome  " +a);            }

Window Object 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.