我做错了什么?
function test()
{
var d = $.Deferred();
var name=prompt("Please enter your name","Harry Potter");
if (name=="aa")
d.resolve();
else
setTimeout(test, 1000);
return d.promise();
}
test().done(function() { alert("It's Ok!"); });