Warning boxes, confirmation boxes, session boxes in JavaScript

Source: Internet
Author: User



<script type= "Text/javascript" >
<!--
document.write ("When the browser does not support JS, the statement body will not be executed. <br/> ");
//single-line comment
/ * Multiline Comment * /
declaration format for variable: var variable name [= value];
var li_a =;
document.write (li_a + "<br/>");
document.write ("People <br/> Republic of China <br/>");

//Warning Box: Alert (n), no return value.
alert ("The people of China \ \");

//Confirm box: Confirm (n); Returns a Boolean value.
var lb_return = false;
Lb_return = Confirm ("Is it performed?");
if (lb_return) {
document.write ("executed <br/>");
}else{
document.write ("not implemented <br/>");
}

//Session box: Prompt (N,V); Returns the string, n is the cue message, and V is the initial value.
var ls_text = "";
Ls_text = prompt ("Please enter user name", "");
document.write (ls_text);
switch (ls_text) {
Case "Admin":
document.write ("You are the Administrator");
{break;}
Case "James":
document.write ("You are a programmer");
{break;}
Default:
document.write ("User name does not exist");
{break;}
}
-
</script>
<script type= "Text/javascript" src= "Javascript.js" ></script>

<body>
</body>

Warning boxes, confirmation boxes, session boxes 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.