JavaScript knowledge (i)

Source: Internet
Author: User

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)

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.