JavaScript is a scripting language for Web pages that supports the development of client and server applications and artifacts! It is an explanatory language that needs to be compiled before it can be run!
The specific syntax is not here to explain! JavaScript is used in Web pages in two ways: directly into the Web page and by reference! I simply use, usually with the first way to join the page directly!
The following is a simple use of JavaScript to check whether the page form input is empty and the effect code map:
1 <HTML>2 <Head>3 </Head>4 <Body>5 <Scriptlanguage= "JavaScript">6 functionCheckform () {7 if(Document.myForm.username.value== "") {8 Alert ("Please enter a title!!!");9 Document.myform.title.focus ();Ten return false; One } A return true; - } - </Script> the <H1Align= "Center">Login interface</H1> - <HR> - <Center> - <formname= "MyForm"Action="#"Method= "POST"OnSubmit= "return Checkform ()"> +User name:<inputname= "username"type= "Text" /><BR> -Dense Code:<inputname= "Password"type= "Password"/><BR> + <inputvalue= "Login"type= "Submit" /> A <inputvalue= "Register"type= "Submit" /><BR> at </Center> - </Body> - </HTML>
Here is simply the use and introduction, we are interested in going deep to learn ha!!!
jsp--Learning article: using JavaScript simply