JSON, a lightweight material in the language, so many web site Ajax request response results are in JSON format below is a standard JSON format
{ "firstName": "John", "LastName": "Smith", "male": true, "age": +, "address": { " StreetAddress ": 2nd Street", "City ": "New York", "State ": "NY", "PostalCode": "10021" }, " PhoneNumber ": [ {" type ":" Home ", " number ":" 212 555-1234 " }, { " type ":" Fax ", "Number ": "646 555-4567" } ] }
But the reality is cruel, often you can not see it so good to understand the JSON format, usually you will only see the following
{"FirstName": "John", "LastName": "Smith", "male": true, "age": +, "address": {"streetaddress": "2nd Street", "City": " New York "," state ":" NY "," PostalCode ":" 10021 "}," PhoneNumber ": [{" Type ":" Home "," number ":" 212 555-1234 "},{" type ":" Fax "," number ":" 646 555-4567 "}]}
If there are non-English language words, it is more dire, as shown below
{"ret": {"status": "false", "MSG": "\u9801\u9762\u5df2\u904e\u671f\uff0c\u8acb\u91cd\u6574\u8a72\u9801\u9762"}}
All become Unicode encoded ... Only the computer can understand what the hell ... In general circumstances may be dropped to the JSON Parser online or JSON pretty print and other Web sites to parse in otherwise is through the browser console to solve the code, there are many ways to solve the code, then it is to introduce how through the sublime Text directly parses the original format of JSON format Hot key: CTRL + ALT + J Pretty JSON Github:https://github.com/dzhibas/sublimeprettyjson detailed installation steps, please continue to look down
1. Please make sure that the package Control is installed
If it is not installed, see: Installation of the first sublime text kit
2. Press CTRL + SHIFT + p and enter the package Control:install Package3. In the input pretty JSON, press ENTER to complete the installation 4. Press Preferences > Package Settings > Pretty JSON > Settings-default? tuning setting 5. The following is the setting, the preset is very useful, not so good to set out
Sublime Text Suite Introduction (iv): Pretty JSON