php - Parse Json string to Html elements -
this question has answer here:
- parse json in javascript? [duplicate] 16 answers
- access / process (nested) objects, arrays or json 15 answers
i have json string : [{"row_id":"1","name":"amoghengineers","category":"dress","subcategory":"jeans","district":"7","location":"india","plan":"gold","productorservice":"product","email":"mymail@gmail.com","about":"goodone","phone":"98675433","registration_confirmed":"yes"}]
.
and need parse these data html field elements ,for eg: want set name input field $("#businessname").val(name)
. how can ? in advance .
you can this,
$("#businessname").val(jsonobjarray[0].name)
edit if have in string can use $.parsejson
jsonobjarray= $.parsejson('[{"row_id":"1","name":"amoghengineers","category":"dress","subcategory":"jeans","district":"7","location":"india","plan":"gold","productorservice":"product","email":"mymail@gmail.com","about":"goodone","phone":"98675433","registration_confirmed":"yes"}]'); $("#businessname").val(jsonobjarray[0].name);
Comments
Post a Comment