~~
window.open (): Open a Window
You need to put three parameters inside:
1. Open the location of the window (webpage);
2. Open the Way (Self page, new page);
Where _blank opens a new window
3. Open the properties of the Web page;
window.open ("http://www.baidu.com","_blank"," width=500 height=500 ")
Window.close (): Close a window
Window.opener.close: Closes the open window (closes the source window)
~~
Interval and delay
Interval: setinterval
Window.setinterval ("Code to execute", "interval number of seconds")
The two parameters inside:
The first piece of code to execute;
The second interval is executed once (milliseconds);
Purge interval:
1. You need to write a variable to the interval:
var AA = window.setinterval ("code name", 1000);
2. In the function method:
Window.clearinterval (AA);//Clear Interval clearinterval
This will only be performed once
Delay: SetTimeout
Window.settimeout ("code name", how many seconds delay after execution (once));
Delay is only performed once
If you write again in the function, you will have a spacer effect:
Function Shao () { window.open ("http://www.baidu.com"); Window.settimeout ("Shao ()", "}window.settimeout" ("Shao ()", 1000)//Purge delay: cleartimeout (variable)
modal dialog box (ie only):
Function Mo () { window.showmodaldialog ();//showmodaldialog modal dialog Box}//showmodelessdialog (): Non-modal dialog box
Modal dialog box: Open post-top, similar to mask layer, click not to the rear.
~~
Forward a page:
Window.history.forward ()
Back one page:
Window.history.back ();
Get page Address:
Window.location.href
Jump page:
Window.location.href= "";
.
Window object in JS: Open windows