javascript - How to use ajax return value from within a function call? -
i have function shown below , not able return data value place calling function.
function checkifrs(){ $.ajax({ url: 'someurl.php', success: function(data) { return data; } }); }
any suggestions helpful...
well , 1 way use callback function inside ajax success
function checkifrs(callback) { $.ajax({ url: 'someurl.php', success: function(data) { callback(data); } }); }
and call way,
checkifrs(function(data){ //do data });
Comments
Post a Comment