I have a nested json. I want to publish it as input form value.
But it seems that jquery puts the string "Object object" in the value.
It seems easier to pass the string and convert it to the form I need, than to deal with json, since I don't need to change anything after creating it.
What is the easiest way to convert json
var json = { "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021" }, "phoneNumber": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ], "newSubscription": false, "companyName": null };
in its lowercase form?
var json = '{ "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021" }, "phoneNumber": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ], "newSubscription": false, "companyName": null }'
The following does not do what I need:
Json.stringify()
json javascript jquery
Lakshman prasad
source share