1) $. parseJSON returns a string instead of a JSON object.
2) to convert a string into an object, it is easy to think of the eval method in JS. In fact, this is acceptable, but parentheses must be added. For example, var js = "{\" PageIndex \ ": \" 1 \ "}"; var obj = eval ("(" + js + ")");. However, using eval is insecure because it can compile any js Code.
3) download a JSON parser because it only recognizes JSON text. This makes it safer. The official JSON website provides such a script. Address: http://www.json.org/json2.js. It is easy to use. After the file is introduced, for example, JSON. parse ($ ("# ctl00_ContentPlaceHolder1_hfSearch"). val (). toString ()).
4) use JSON. parse method or $. when using parseJSON, note that the name and value of JSON data are enclosed in double quotation marks. For $. the parseJSON method also enclose the JSON string in single quotes before conversion. For JSON. the parse method is no longer required. Really TMD is a waste of time.
Pay attention to these skills, so you can avoid a lot of detours when operating JSON data.