How to get data in jsonformat using jquery .I want to get this type data
var myCustom={ 'item':[{'id':123,'quantity':1},{'id':134,'quantity':2}]};
Please send me any solution with any example in button click.
How to get data in jsonformat using jquery .I want to get this type data
var myCustom={ 'item':[{'id':123,'quantity':1},{'id':134,'quantity':2}]};
Please send me any solution with any example in button click.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Jun 7, 2021, 6:45 AM EDT
Pranam BhatRank #500 · 4.9K reputationPosted Jun 7, 2021, 6:48 AM EDT
Use the JavaScript function JSON.parse() to convert text into a JavaScript object:
const item = JSON.parse('{"id":"123", "quantity":1, "id":"134", "quantity":2}');