javascript - About modifying the key value of json
漂亮男人
漂亮男人 2017-07-05 10:54:54
0
1
1099

For such a business requirement, the background returns a string of json data for displaying information, and can modify the value corresponding to the json key, and then save the modified json data.
Similar to the json viewer, a friend gave me an idea, which is to first determine whether the json data is an array and whether there are sub-elements, and then determine whether it is an object. If there are sub-elements, recursion must be used. . . However, I still don’t know how to do it, so I’d like to ask a master for advice. Please help me solve it.
Attached is a diagram of the json viewer

漂亮男人
漂亮男人

reply all(1)
三叔

Baidu/Google js recursively traverses json A lot

If you modify a node key, you know the key to be modified, and then save the value. The user enters a new key, assigns the key the value you just saved, and then deletes the original key

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!