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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pranam BhatPosted Jun 7, 2021, 10:48 AM
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}');
Sachin SinghPosted Jun 7, 2021, 10:45 AM