Java Script Basics (i)
First, why learn JavaScript
There are two main reasons for learning JavaScript.
1. Client form validation.
2. Achieve page interaction (web effects)
Second, what is JavaScript
JavaScript is a descriptive language, a security-friendly script that is based on object and event-driven (driven). It runs on the client side, thereby alleviating the burden of Wu's blessing. Its characteristics are as follows:
1. JavaScript is used primarily to add interactive behavior to HTML pages.
2. JavaScript is used primarily to add interactive behavior to HTML pages.
3, JavaScript is generally used to write client script.
4, JavaScript is an explanatory language, the side of the execution side interpretation.
Third, the composition of JavaScript.
A complete JavaScript consists of 3 different parts of the core syntax (ECMAScript), the browser object model (BOM), and the Document Object Model (DOM).
Iv. basic JavaScript syntax
<script type= "Text/javascript" >
<!--
JavaScript statements
-
</script>
Description
<script></script>: Represents a script tag, JavaScript script must be written in the script tag.
<!--statement-->: is a comment tag that tells browsers that do not support JavaScript to ignore the JavaScript code contained in the tag.
Type: property indicates that the language category used is JavaScript.
V. How JavaScript scripts are referenced in the page
JavaScript is embedded in a Web page as a script there are 3 ways:
1, use <script></script> label.
2. Use external. js file.
3, write directly in the HTML file.
Java Script Basics (i)