JavaScript Learning Notes _ overview

Source: Internet
Author: User
Tags script tag

1. JavaScript is a scripting language based on objects and events.

2. Features:

1) Security (does not allow direct access to local hard disks). What he can do is the dynamic interaction of information.
2) Cross-platform (as long as the browser can interpret JS can be executed, and platform-independent.) )

3. JavaScript is different from Java
1) JS is the product of Netscape Company, Java is the product of sun company.
2) JS is Object-based and Java is object-oriented.
3) JS just need to explain to run, Java needs to be compiled into a bytecode file, and then execute.
4) JS is a weak type, Java is a strong type. (There is no type in JavaScript to say Var)
There is no string concept in JavaScript, and the concept of single and double quotes is the same.

4. How to combine JavaScript with HTML
You want to incorporate other code into your HTML, in the form of a label.
1) JS code is stored in the label to <script>...</script>.
2) using the SRC attribute of the script tag to introduce a JS file (convenient for later maintenance, extension)

Cases:

    1. <script src="test.js" type="Text/javascript" ></script>

Note: The type attribute must be added to the script tag in the specification.
Added
How to define script one:
    1. <script type="Text/javascript" >
    2. //Store JavaScript code here
    3. Alert ("KKK"); //This is the most common JavaScript-validated statement
    4. </script>

Script is defined in two ways:
      1. <script type="Text/javascript" src="e.js" ></script>

JavaScript Learning Notes _ overview

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.