1.1. Thumbnail mark
//Defining Objects//var car = new Object (); //car.colour = ' red '; //car.wheels = 4; //car.hubcaps = ' spinning '; //car.age = 4; //the simple wording of the above code: varCar ={colour:'Red', Wheels:4, Hubcaps:'Spinning', Age:4 }//Defining Arrays varTestarr =NewArray ('str1','str2','STR3','STR4'); //the simple wording of the above code: varTestarr = ['str1','str2','STR3','STR4']; //Associative Arrays varCar =NewArray (); car['Colour'] ='Red'; car['Wheels'] =4; car['hubcaps'] ='Spinning'; car[' Age'] =4;
Triple Marker method
var direction;
if (x<200) {direction=1;} Else{direction=-1}
The triple notation can be written as
var direction=x<200?1:-1;
1.2. JSON data format
JSON is the abbreviation for JavaScript Object notion
Description band var band = { "name": "The Red hot Chili Peppers", "members": [ { "name": "Zhangsan", " Role ":" Lead vocals " }, { " name ":" Lisi ", " role ":" Bass guitar,trumpet,backing vocals " } ], "Year ": "The" }
Json-p cross-domain application: http://www.cnblogs.com/chopper/archive/2012/03/24/2403945.html
Seven things you need to know about beginners JavaScript