Javascript--1

Source: Internet
Author: User

What can JavaScript do?

It can directly respond to user or customer input, do static page interaction!

Do some website special effects function!


What is JavaScript?
JavaScript is a literal-translation scripting language, which is a dynamic type, a weak type, a prototype-based language, and a built-in support type.


How do I apply JavaScript to a Web page?

Internal type

<script type= "Text/javascript" >

var name= "Zhang San";

</script>

Embedded

<script src= "Js/special.js" type= "Text/javascript" charset= "Utf-8" ></script>

JavaScript-Syntax


Named

<br> integers: Consists of a sign, a number, an octal, a decimal, a hexadecimal; <br> floating-point number: By the sign, the number and the decimal point, the general method of counting, scientific notation; <br> logical value: True, False <br> String value: Single quotation mark, double quotation mark <br> null value: null <br> undefined value: An object that does not exist at all, a quantity that has been defined but not assigned a value; <br> <br> <script language= "Java   Script "> var stdId;   var total=3721;   var notnull=true;     var name= "Bruce Lee", sex= "Mr.";      var i=j=0;  var hobby=["Listen to Music", "See the film"];  Hobby[2]= "123";  var test;  StdId = 2004007;  document.write ("Variable stdid=" +stdid+ "<br>");  document.write ("Variable i=" +i+ "<br>");  document.write ("Variable j=" +j+ "<br>");  document.write ("Variable name=" +name+ "<br>");  document.write ("Variable sex=" +sex+ "<br>");    document.write ("Variable notnull=" +notnull+ "<br>");  document.write ("Variable hobby=" +hobby+ "<br>");  document.write ("Variable hobby[0]=" +hobby[0]+ "<br>");  document.write ("Variable hobby[1]=" +hobby[1]+ "<br>");  document.write ("Variable hobby[2]=" +hobby[2]+ "<br>");  document.write ("Variable hobby[3]=" +hobby[3]+ "<br>"); document.write ("Unassigned variable test=" +test+ "<br> ");    document.write ("Non-existent value (0.0/0.0) =" + (0.0/0.0) + "<br>"); var t1=1.7976931348623157e+10308 document.write ("Positive value out of range" +t1) document.write ("<br/>") var t2=-1.79769313486 23157E+10308 document.write ("negative value out of range" +t2) </script>

Comment Statement

      1. Single-line Comment
      2. /*
      3. Multi-line comments
      4. */

Javascript--1

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.