运行以下代码: res1已满, res2是空的, res3为空,
如何更改结果变量并将其用作最大功能的返回
function fillusers() {
var result = '';
$.when(
$.getScript("http://localhost:9090/app/dwr/engine.js"), $.getScript("http://localhost:9090/app/dwr/util.js"), $.getScript("http://localhost:9090/app/dwr/interface/myService.js"), $.Deferred(function(deferred) {
$(deferred.resolve);
})).done(function() {
myService.getUsers({
callback: function(str) {
result = jQuery.parseJSON(str);
console.log('res1' + result);
}
});
console.log('res2' + result);
});
console.log('res3' + result);
return result;
}