The window in JavaScript

Source: Internet
Author: User
Tags setinterval

<!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

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.