JavaScript of HTML

Source: Internet
Author: User

Tags: core case-sensitive multi-state display technology Tor Job center SPL


First, JS overview

1.1 JS History

    • 1992 Nombas developed the embedded scripting language for C-minus-minus (c--) (originally bundled in Cenvi software). Rename it scriptease. (The language that the client executes)
    • Netscape (Netscape) received Nombas's philosophy, (Brendan Eich) developed a set of Netscape scripting languages in its Navigator livescript 2.0 product. Sun and Netscape are done together. And then the name is JavaScript.
    • Microsoft then emulated a JavaScript clone called JScript in its IE3.0 product.
    • To unify the three, the ECMA ( European Computer Manufacturing Association) defines the ECMA-262 specification. The International Organization for Standardization (ISO/IEC) also adopted ECMAScript as the standard (iso/iec-16262). From then on, the Web browser began to work (albeit with varying degrees of success and failure)

1.2 ECMAScript

Although ECMAScript is an important standard, it is not the only part of JavaScript, and certainly not the only one that is standardized. In fact, a complete JavaScript implementation is made up of the following 3 different parts:

    • Core (ECMAScript)
    • Document Object Model (DOM) Documents object models (consolidated js,css,html)
    • Browser object models (BOM) Broswer object Model (integrated JS and browser)
    • The vast majority of Javascript in development is object-based. It is also object-oriented.  

To put it simply, ECMAScript describes the following:

      • Grammar
      • Type
      • Statement
      • Key words
      • Reserved words
      • Operator
      • Object (encapsulates inherited polymorphism) based on the language of the object. Working with objects

Introduction Method of 1.3 JS

1 {#1 Write #}2     <script>3         alert (' Hello Yuan ') JS block is recommended to be placed at the bottom of the body block  4     </script>5 {#2 import file #}6     <script src= "Hello.js" ></script>

Second, JS basic knowledge

2.1 Variables

Declare variables using the keyword ' var ', var a=1;

You can declare multiple variables on a single line.var name="lfd", age=20, job="lecturer";

   You can declare variables without var. If you do not use Var then it is a global variable.

   Variable name, the first character can only be letter, underscore, $ dollar symbol three select one, and case-sensitive, x and X are two variables.

Variable naming laws:

 1  camel notation  2   The first letter is lowercase and the next letter begins with an uppercase character. For example:  3  var  mytestvalue = 0, Mysecondvalue = "HI"  4  pascal notation  5   The first letter is uppercase and the next letter begins with an uppercase character. For example:  6  Var mytestvalue = 0, Mysecondvalue = "HI"  7   Hungarian type notation   8   9  Var imytestvalue = 0, Smysecondvalue =" HI "; 
View Code

JavaScript of HTML

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: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: