ajax - Unable to use dynamic JSON -
am using ajax request calling jersey restful url.
function deregisterpersonorganization() { var dynamicjson = $('#jsonrequest').val(); alert("text area json : " +dynamicjson); var jsonobj = { "solutionproviderkey" : "e3fad159-ac18-462d-a20e-17763af3689b" }; $.ajax({ type: 'post', contenttype: 'application/json', url: rooturl + '/e3fad159-ac18-462d-a20e-17763af3689b/deregister', datatype: "json", data: json.stringify(dynamicjson), success: function(data, textstatus, jqxhr){ alert('deregister successfull'); }, error: function(jqxhr, textstatus, errorthrown){ alert('deregister error: ' + textstatus); } }); }
the problem need give json request give through text area. in above code if use variable jsonobj in place of dynamicjson request successful. if use dynamicjson in textarea give
{ "solutionproviderkey" : "e3fad159-ac18-462d-a20e-17763af3689b" }
as request, unable process request.
please me possible.
turn string json object.
var dynamicjson = json.tojson($('#jsonrequest').val());
kj
Comments
Post a Comment