Home  >  Article  >  Web Front-end  >  js method to convert json format content into objects_javascript skills

js method to convert json format content into objects_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:18:061182browse

Copy code The code is as follows:

{"options":"[{"text": "Wangjiawan","value":"9"},{"text":"Lijiawan","valu
e":"10"},{"text":"Shaojiawan"," value":"13"}]"}



Javascript can complete the traversal.

Copy code The code is as follows:



If your initial json is of string type, it must be converted to a json object. Use eval();
For example: var json = eval(strJson);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn