First, I would like to share two words for you:
Listen to wisdom, concentrate on the wise, cry for Mingzhe, and ask for cleverness. --Proverbs 2:2-3
You have to keep your heart, better than to keep everything, because the effect of life, is made by the heart. --Proverbs 4:23
... O (∩_∩) o ... Learning the basics of JavaScript today, let's summarize:
Theory:
* The composition of the JavaScript language:
1:ecmascript
2:bom (Document Object model)
3:dom (Browser object model)
* Features of the JavaScript language:
The use of the Minimum program section of the programming, and HTML together, so that users more convenient operation of the Web page. In addition, the JavaScript language also has the following features:
Security
Ease of Use
Dynamic interactivity
Platform-based
* JavaScript, as a scripting language, has its own common elements, such as constants, variables, operators, functions, events, objects, and so on.
* The top-level parent class of JavaScript is window
* JavaScript provides four types of data: numeric, character, Boolean, and null values. Undefined types are represented by undefined
* The JavaScript language defines the variable as the keyword var, which is defined by using the keyword function
Real:
<script>
vars = "Nice Too metting You"; Window.alert (typeofs);//View Typealert (s.length);//View Length varArray = S.split (");//split string to get character array for(vari = 0; i < Array.Length; i++)//traversing out characters{alert (array[i]); } alert (S.trim ()); //Remove both spacesAlert (s.substring (0, 4));//Intercept StringAlert (S.charat (3));//find characters by indexAlert (S.charcodeat (2));//find ASCII values by indexAlert ("Hello". Concat (s));//Connection CharacterAlert (S.indexof ("M"));//index value of m foundAlert (S.replace ("metting", "metting"));//Replace
</script>
String Goto Boolean
<script>
var s = ""; var false ; if (s) { // If the string s is not empty, turn to true, otherwise turn to false; alert (s) } else { alert ("empty string"); }
</script>
Definition and use of methods
Note : in JavaScript, any type that is added to a string type is converted to a string type and then concatenated with its string. If you want to get the int type, you can use the method parseint () conversion or use number ().
The maximum value printed is:
The above is the knowledge learned this afternoon, tomorrow will continue to learn JavaScript scripting language, refueling! O (∩_∩) O..
JavaScript knowledge (i)