JavaScript Tags:Two ways to introduce JS:1.2.JS is either written between the head or written between the body.Data type:Variable declaration: var variable name = value;var can omit variable name = value;Type: NULL, Boolean, Integer, floating point (
JSON (JavaScript Object Notation) is a lightweight data interchange format that is ideal for data interchange formats in a completely language-independent text format. At the same time, JSON is a native JavaScript format, which means that working
Read "You don't know JavaScript" a book to make a note;Compiler principle:JS is a compiled language, similar to the traditional compilation language, the traditional compilation process is divided into three stages;1. Word segmentation/lexical
Overview: JS's eval (str) can be used to return the evaluated results of a mathematical expression, but the brackets "[" and "]" of the expression denote the connector, unlike the "curly braces, after brackets," in the arithmetic, the braces "{"
Before I have been not particularly familiar with Ajax, so generally rarely use this to write function, but recently used in this project, using AJAX asynchronous data transfer, JSON data will need to parse the data sent over, eval () and
one, JSON to string varstr = "1: Test 1-1; 2: Test 1-2; 3: Test 1-3";//string varSTR0 = Str.split (';');//string to Array ["1: Test 1-1", "2: Test 1-2", "3: Test 1-3"] /*Method One*/ //using $
1. Array Object arrayvar temp = [{' name ': ' 123 ', ' Age ': '},{' ' name ': ' 123 ', ' Age ': ' 18 '}]2. JSONOne, JSON string converted to JSON objectTo use the above str1, you must first convert to a JSON object using the following method:Convert
1. The first difference is: securityJSON format is very popular, and the way to parse JSON is usually json.parse () but the eval () method can also be parsed, what is the difference between the two?Json.parse () can parse data in JSON format and
The common methods of global, Math, and date types in JavaScript are as follows:1 /*2 The global object in JS is a nonexistent object, and the method inside it can call3 Common methods:4 1 encodeURI Convert the URI byte, do not change the special
When converting to Python's built-in data types, you can use built-in functions, which are commonly used for type conversion functions
python common type conversion functions
function format
Using the example
Points:1. Using Localstorage StorageThe 2._change_record_progress function takes a string as a parameter and uses eval to perform this parameter3. jquery custom events are used to update the display in real time when data changes4. CSS issues are
Convert a JSON object to a stringvar loginuser = {username:username, Password:password}Way One Localstorage.setitem (json.stringify (loginuser));Way TwoLocalstorage.setitem ("Loginuser",loginuser.tojsonstring ());Convert a string to a JSON object//
For example:JSON string:var str1 = ' {' name ': ' cxh ', ' sex ': ' Man '} ';JSON object:var str2 = {"Name": "Cxh", "Sex": "Man"};One, JSON string converted to JSON objectTo use the above str1, you must first convert to a JSON object using the
To introduce: Jquery-json-2.4.jsIn the process of data transfer, JSON is passed in the form of text, which is a string, and JS is the JSON object, so the conversion between JSON object and JSON string is the key. For example: JSON string: var str1 =
The value that the variable is stored in memory. This means that there is a space in memory when creating variables.Based on the data type of the variable, the interpreter allocates the specified memory and determines what data can be stored in
parenthesesJavaScript small brackets have five semanticssemantics 1, Parameter table when function declarationfunctionFunc (ARG1,ARG2) {// ...}semantics 2, combined with some statements to achieve certain qualifiersUse with for for(varAinchobj) {//
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.