Tag: 匿名

从匿名异步函数返回数据?

考虑: function ajaxCall(url, callback) { $.ajax({ type: “GET”, url: url, success: function (data) { // <– fail point: where does the returned data go, now? // do stuff with data if ( callback ) { var ret = callback(); if ( ret !== undefined ) { return ret; } } } }); } function fooBar() […]