My jquery ajax call below is always returning error. First time ajax for me, I have followed the samples here but I cannot get successful call. I did prove via debug that Controller is successfully returning a query result set, so the problem must be in the ajax call below. Thanks for any help.
$('.link_board_filter_image').click(function () {
var dataObject = JSON.stringify({
'p_db_type': $(this).data("db_type"),
'p_sch': $(this).data("sch"),
'p_own': $(this).data("own"),
'p_env': $(this).data("env"),
'p_object_type': $(this).data("object_type"),
});
alert("dataObject: " + dataObject); // at runtime this looks perfect.
$.ajax({
type: 'POST',
async: false,
dataType: 'json',
contentType: 'application/json',
data: dataObject,
success: function (data) {
response($.map(data.d, function (item) {
return { value: item }
}))
},
error: function (result) {
alert("Error: " + result.error); //when runtime this result.error string is unhelpful (to me)
}
});
});