I have a string:
'{format: "json", user: "user", password: "password"}'
and I want to send all this data using jQuery's AJAX. I've tried this way (requestData['data'] is the string) :
$.ajax({
url: requestData['url'],
type: requestData['type'],
data: requestData['data'],
error: function(xhr) {
alert("failed");
},
dataType: 'json',
success: function(data, textStatus, xhr) {
alert("success");
}
});
Do I have to encode the string somehow?