if you need double quoted JSON use
Ref : https://stackoverflow.com/questions/12979335/creating-json-object-with-variables
JSON.stringify( object)
var $items = $('#firstName, #lastName,#phoneNumber,#address ')
var obj = {}
$items.each(function() {
obj[this.id] = $(this).val();
})
var json= JSON.stringify( obj);
Ref : https://stackoverflow.com/questions/12979335/creating-json-object-with-variables
Comments
Post a Comment