I have some web services that receive JSON data send by jquery method.
But I need to edit the object before send this data. Is there any way to parse a JSON object to a simple object in javascript, modify it and then parse it again to JSON. or maybe update this JSON object without parse it?
I have some web services that receive JSON data send by jquery method. But
Share
To go from a JSON string to a JavaScript object:
JSON.parse, or$.parseJSONif you’re using jQuery and concerned about compatibility with older browsers.To go from a JavaScript object to a JSON string:
JSON.stringify.Even better though, if you save a reference to the object before stringifying it, you don’t have to parse the JSON at all: