// AjaxHandler
function AjaxHandler(url, dataContent){
$.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: dataContent,
async: true,
cache: false,
success: function(obj){
console.log(obj);
return obj;
}
});
}
$("#button").click(function(){
AjaxHandler( "http://xxxxxx/yyyyyy.api", "some data" );
alert(obj);
});
If I can get object data from called function "AjaxHandler". How do I use this object data??I try to alert obj but show not define.
I can print obj data in console in function AjaxHandler. So the data is there. I just don't know how to use it after called function.