In-depth analysis of the functions of JSON. parse (), JSON. stringify () and eval (), json. stringifyeval
"JSON (JavaScript Object Notation) is a lightweight data exchange format. It is based on a subset of ECMAScript. Because it adopts a
JSON strings are parsed into JSON data formats in JS. There are two methods:
1. Use the eval () function.
2. Use the function object for return parsing.Use the eval function to parse and use the jquery each method to traverse
The JSON data parsing
Statement:
First of all, I am a newbie to JS, So I dare not go into depth. I just share my recent eval learning experience with you. If you are a master, I can skip it.
Suitable for readers:
I have no idea how eval converts a string to a JSON
First, the use of eval, the content is relatively simple, familiar can skipThe Eval function receives an argument s, and if S is not a string, it returns directly to S. Otherwise execute the S statement. If the S statement executes the result is a
The eval usage eval function receives an argument s, and if S is not a string, it returns directly to S. Otherwise execute the S statement, here is an example of eval parsing JSON First of all, the use of eval, the content is relatively simple,
Reprinted from: http://blog.snsgou.com/post-13.htmlIn JS, the JSON string is parsed into a JSON data format, typically in two ways:1. One for using the eval () function.2. Use the function object for return parsing.The first parsing method: Use the
Original address:http://www.jb51.net/article/21688.htm This article focuses on the relationship between the Eval function and the JSON data format, as well as some detail issues. If you would like to learn more about Eval and JSON, please refer to
Analysis of precautions for using eval to parse JSON in JS, and jseval to parse json
This article analyzes in detail the precautions for using eval to parse JSON in JS. We will share this with you for your reference. The details are as follows:
JSON
JavaScript eval () function definition and usageThe eval () function computes a string and executes the JavaScript code in it.GrammarEval (String)
Parameters
Description
String
Necessary. The string to
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.