JavaScript Introduction:
JavaScript is a scripting language that belongs to the web!
JavaScript is used by millions of of pages to improve design, validate forms, detect browsers, create cookies, and apply more.
JavaScript is the most popular scripting language on the Internet.
The following focuses on the composition of JS, Introduction, Output, operator basics, specific details are as follows:
JavaScript composition:
ECMAscript
Browser Object Model BOM
Document Object Model DOM
ECMAScript BOM Dom
The DOM (Document Object model) is used to access and manipulate HTML documents
BOM (Browser object model)
JS is the browser language
JavaScript Introduction:
1 <script src= "Xxx.js" > </script>
2 Introduction of external files
3 Inside tags use attributes to write JavaScript code
Encoding Format UTF-8
Alert ("")
document.write ("")
Double quotes what you want to display is a double quote number, which is a numeric value without double quotes.
Single quote double quotes alternately used in pair appearance
<a href= "Javascript:alert (' China ');" > Stand-alone </a>
You can't have double quotes in China. Will cause a conflict with the preceding double quotes
Single-line Comment/**/multiple-line Comment
Variables let the computer record (store) a data that is stored in a value
Cannot add a number before a variable name
= equals Sign represents assignment
Want to have the character string store double quotes
Double quotes are character/string types
sum+=10 equal to Sum=sum+10
++y first after the operation Y++ first participate in the operation and then add
+ Number has link action and add action
x=“110” d .w(x + 10) 输出 11010
x= 110 d.w(x+10) 输出 120
var x = "the";
x = parseint (x);//x=110
document.write (x+10);
d.w(x) 输出120
var y=8;
document.write (y+ "" +10) result 810 empty characters also provide the opportunity of word linked,
Operator
Relational operator method > < >= <=!= = = = = = = =
Indicates a relationship produces a Boolean type result meaning: Ask the computer if it's right or wrong.
Logical operator && has false on false | | There's ture, ture.
&& | | Short-circuit operators if the first condition of comparison can end the comparison, then no comparison is performed.