I use jQuery's ajax function to call a url asynchron like this:
jQuery.ajax({
url: url,
type: "GET",
data: {key : value},
success: function(data) {
console.log(data);
}
}
On the server side I don't know what to return to get something meaningful inside the variable data
. The console's log is just empty string.
I already tried return 0
, return 1
, return array('status' => 1)
, return true
Background: I want to know if any exceptions have been thrown on the server side to pass something like false or true if it was successful without exceptions.
EDIT: Server side language is PHP