<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8" /> <Metaname= "Viewport"content= "Width=device-width, initial-scale=1"> <title>The window in JavaScript</title> <!--Window Learning 1.Window Common Method dialog box alert---Pop-up warning box (pop-up window can only be determined) confirm----confirmation Box (pop-up window can be determined, You can also click Cancel), click OK to return True, point Cancel will return false prompt---prompt ("description content"): Pop Up an input box, and can get input results delay function setTimeout ("Actuator milliseconds)----Delay the specified number of milliseconds, and then perform the specified action, which can be a different method or an anonymous method, note that the specified delay function must be quoted cleartimeout---clear Setinterva L ("Execute action", number of milliseconds)---every few seconds this function sub-window window.open ("open.html", "Win", "width=100,heigt h=200 ") window.close (); Close window 2.location 3.history - <Scripttype= "Text/javascript"> varIDs; functionTestalert () {alert ("Test Alert"); } functiontestconfirm () {varTESTC=Confirm ("Test Confirm"); alert (TESTC);//Click OK to return True, and the point cancel will return false, } functiontestprompt () {vartetsp=Prompt ("Please enter a value"); alert (TETSP); } functiontestTimeout1 () {setTimeout ("alert (' Use alert directly ')", -); } functiontesttimeout () {setTimeout ("testtimeoutfunction ()", the);//to invoke another method } functiontesttimeoutfunction () {alert ("drop-in method"); } functionTestTimeout2 () {IDs=SetTimeout (function() {alert ("Anonymous Methods"); }, +); } functiontestcleartimeout () {cleartimeout (IDS); } functionTestsetinterval () {setinterval (function() {alert ("Delay Function"); }, +); } functionTestwindow () {window.open ("son.html","win","width=20,heigth=10,top=100,left=100"); } </Script> </Head> <Body> <inputtype= "button"value= "Test Alert"onclick= "Testalert ()" /> <inputtype= "button"value= "Test Confirm"onclick= "testconfirm ()" /> <inputtype= "button"value= "Test Prompt"onclick= "testprompt ()" /> <HR/> <inputtype= "button"value= "Test SetTimeout1"onclick= "testTimeout1 ()" /> <inputtype= "button"value= "Test settimeout"onclick= "Testtimeout ()" /> <inputtype= "button"value= "Test SetTimeout2"onclick= "TestTimeout2 ()" /> <HR/> <inputtype= "button"value= "Test Cleartimeout"onclick= "Testcleartimeout ()" /> <HR/> <inputtype= "button"value= "Test SetInterval"onclick= "Testsetinterval ()" /> <HR/> <inputtype= "button"value= "Test child window"onclick= "Testwindow ()" /> </Body></HTML>
Also set up a sub-window Test window.close ()
The Code for the child window:
<! DOCTYPE html>
The window in JavaScript