I have a JSON string
var str = '{'+
'"name": "John Doe",'+
'"company": [{"name": "ABC Corp"}, {"name": "XYZ Corp"}],'+
'"salary": "$200000"'+
'}';
I make the ajax call as
$.ajax({
url: 'url',
type: 'POST',
context: document.body,
dataType: 'json',
data: str,
success: function(data){},
error: function(error){}
});
How can I escape the double quotes inside the JSON array before making the ajax call.