I'm trying to reuse ajax
to make it more mobile in my project.
Put it in the following way waiting for an answer but no.
function _ajax(params,uri,type){
$.ajax({
url: uri,
type: type,
dataType: 'json',
data: {params},
success: function(data){
return data;
}
});
}
Send it to call:
var result = _ajax(null,'http://','GET');
console.log(result);
console:
undefined
As I can reuse it, the answers come in JSON