* task :
* onchange event
* this: Indicates that label , conclusion : Click that tab , That label is this
* javascript Built in objects for
* Global object : Gloabl, Only name , The actual object does not exist , characteristic : Method name ( parameter );
* Math object : floor(), Round down , ceil() Round up , random(), random number
* JSON object
*1. effect : front end and back-end In data interaction , use json
*2. json definition : 1. Define single json 2. definition json array , 3. complex json
*3. json analysis : json object .key
*javascript object-oriented ( Just understand ) <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <
title></title> </head> <body> <script> /* * Global Global object : Only name , So when you call a method , Write the method name directly
1. eval(): Parse a normal string into js Code execution 2. isNaN(): Judge whether it is a number 3.
parseInt(): Convert a number of string type to number Type number 4. parseFloat(): Convert a string type floating-point number to float Floating point number * */ //1.
eval(): Parse a normal string into js Code execution document.write(2222222);// Method call var str1 =
"document.write(11111)";// character string //eval(str1);// Remove the double quotation marks , Method call //2.isNaN(): Judge whether it is a number
//var numer = 10; var numer="10a"; // If it's a number , return false, Not a number , return true var flag1 = isNaN
(numer); document.write(flag1); document.write("<hr/>"); //3. Convert to integer var number1 =
"10";//string document.write(typeof number1); var number2 = 10;//number document
.write("<hr/>"); // string--->number var number3 = parseInt(number1); document.
write(typeof number3); //4. Convert to floating point number : ellipsis </script> </body> </html> <!DOCTYPE html>
<html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <script> /*
* floor();" Floor method " Round down , such as : 5.9--> Round down 5 * ceil();" Ceiling method " Round up , such as :5.01--> Round up 6 *
random(); random number , Range [0,1); contain 0, Not included 1 */ //1. Define a number var n1 =2.9; var n1_end =
Math.floor(n1);//2 var n2 =3.0001; var n2_end = Math.ceil(n2);//4 //2. Paging scenario :
According to the total number of records And the number of entries displayed per page , Find total pages var t = 100;//select count(*) from table_name var p =
5;// Number of items displayed per page var totalPage = (t%p==0) ? (t/p) :(Math.ceil(t/p));
//document.write(" PageCount :"+totalPage); //3. scene : obtain 0-5 Between random number var n1 =
Math.random()*6;// Range :[0,5.9999999999999) var n2 = Math.floor(n1);// Range :[0,5];
document.write("0-5 random number :"+n2); </script> </body> </html> <!DOCTYPE html> <html>
<head> <meta charset="UTF-8"> <title></title> </head> <body> <script> /** *
json summary * It is a lightweight data format , Similar to map * json characteristic * 1. Less data * 2. Description data , More intuitive , clear * json effect *
front end <----json-----> back-end * json definition * first kind : single json object * Type II : json Array object * be careful : *
1. Don't put double quotation marks around braces * 2. In braces, except for numbers without quotation marks , All other values are quoted * 3. No mistakes : All values are quoted * json analysis * * Borrow Yang Chongwei :
Peel onion * * first kind : single json object : json object .key;// map.get(key) * * Type II : json Array object * Step 1 :
Get a single from the array json * Step 2 : json object .key * In actual development : And complicated json data format */ // json of key : first //
json of value: {"id":111,"name":"jack"} var casjson={
"first":{"id":111,"name":"jack"} }; // Parsing complex json format //var casUser =
casjson.first;//{"id":111,"name":"jack"} //var casUserID = casUser.id; var
casUserID =casjson.first.id; document.write(casUserID); //1. first kind : single json object var
user={"id":1,"name":"jack"}; var id = user.id; var name = user.name;
//document.write(id+","+name); //2. Type II : json Array object var users= [
{"id":1,"name":"jack"}, {"id":2,"name":"rose"}, {"id":3,"name":"ship"} ];// Static array
//3. Traversal array for(var i=0;i<users.length;i++){ // Step 1 : Get a single from the array json var u = users[i];
// Step 2 : json object .key //document.write(u.id+","+u.name+"<br/>"); } </script>
</body> </html>

Technology
©2019-2020 Toolsou All rights reserved,
【C++ Must see for entry 】C++ from 0 reach 1 Introductory programming axios Interceptor packaging and use Spring Boot Interview must ask : Automatic configuration principle VMware 16 install centos 7 Detailed tutorial C Language data structure - Sequence table delete duplicates V2.0.0 The 12th Blue Bridge Cup c++b Group personal problem solving On sending data from serial port single chip microcomputer to upper computer centos7 install RabbitMqjava Polymorphic array of opencv-python Fourier transform and inverse transform