JavaScript Learning Note Jsbom Seventh (original) Reference JS usage table

Source: Internet
Author: User

<HTML>    <Head>        <title>Day02_js</title>        <Scripttype= "Text/javascript"language= "JavaScript"src= "Js/test1.js"></Script>    </Head>    <Body>        <form>            <H2>1.BOM Demo for Window</H2>            <inputtype= "button"onclick= "testconfirm ()"value= "Confirm Test"/><BR/><BR/>            <inputtype= "button"onclick= "Testpromp ()"value= "Promp test"/><BR/><BR/>            <inputtype= "button"onclick= "Opentest ()"value= "Open Test"/><BR/><BR/>            <inputtype= "button"onclick= "Closetest ()"value= "Close Test"/><BR/><BR/>            <inputtype= "button"onclick= "Refreshtest ()"value= "Refresh Test"/><BR/><BR/>            <input/><BR/><BR/>            <inputtype= "button"onclick= "Navitest ()"value= "Console View information test"/><BR/><BR/>            <inputtype= "button"onclick= "Timetest ()"value= "timing Start"/>            <inputtype= "button"onclick= "Cleartime ()"value= "Timed End"/>            <inputID= "I1"/><BR/><BR/>        </form>    </Body></HTML>
functiontestconfirm () {varf = window.confirm ("Are you sure this is the operation?") ");//OK add cancel popup parameter custom, return value for click OK =true, click Cancel =false;alert (f);//Print the returned boolean value}functionTestpromp () {varf = window.prompt ("Please enter user name", "Jay Chou");//prompt plus text plus OK plus cancel popup first parameter prompt, second parameter default valuealert (f);//NULL is returned when the value point in the Print input box is canceled}functionopentest () {//window.open ("http://www.baidu.com");//Open a new page    varConfig = "toolbar=yes,width=500,height=300";//Toolbar Show Toolbarwindow.open ("http://www.baidu.com", "1", config)//parameter 1 is custom, otherwise you cannot open a new window according to the size of config}functionclosetest () {window.close (); //Close the current page}functionrefreshtest () {window.location.reload (); //page Refresh}functionnavitest () {vararr =NewArray (5);  Console.dir (arr); //Console.dir () can display all properties and methods of an object in the console.     //Console.log (window.navigator.appVersion);   Will print out the information in the browser console. View the currently viewed version    //Console.dir (window.navigator.appVersion);}varTimer//Window Timerfunctiontimetest () {Timer= Window.setinterval (' func () ', 100);}varCount = 0;functionfunc () {count++; document.getElementById ("I1"). value=count;}functionCleartime () {window.clearinterval (timer);}

JavaScript Learning Note Jsbom Seventh (original) Reference JS usage table

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.