Window browser window object

Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes.

Window The browser window object represents the entire window. The
Window properties are as follows:
Closed returns true | false to determine whether the window is closed

image

Innerheight returns the height of the
inner page Innerwidth returns the width of the inner page

image

Opener returns the window object
Outerheight returns the height of the outer window
Outerwidth returns the width of the outer window
Parent returns the parent window

The Window method is as follows:
Close(); Close the window
Alert(“String”); Pop up the dialog
Confirm(“String”); Pop up the confirmation cancel box to cancel and return to false Confirm to return to true

image

Prompt(“String”); Pop up the input box and return String type
scrollBy(x,y); Scroll up and down by pixel x, left and right y

imagescroll up

scrollTo(); scroll to the specified coordinate
setTimeout("function call", time in milliseconds); how long to rest to trigger the function call

image

open("URL"); is used to open a window, which is not supported by many browsers

Window event:
Onresize event is fired when the window size changes

image

There are also mouse events and keyboard events. If you really want to use them, go to Baidu to see what the events are!

Window.document mark the document object to find what mark mark value, etc.
Document properties:
domain returns the domain name

image

Referrer returns the current domain name and also url
Url Returns the most comprehensive url

image

LastModified returns the current web page time

image

Tile returns the title of the web page. You can also set the title yourself with tile=”title”

image

Document method
getElementByid("id"); give him a tag id and return tag object
getElementByName("name"); find tag object by Nana
getElementsByTagName(); search by tag name
Writer("String"); output
Writerln("String ”); output but he will have a blank space at the end

Window.history History on a web page
Window.location Address bar http:// This line
Window.scree The window object gets the width and height of the browser window

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326762823&siteId=291194637