Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下内容:
var archiveFolders = function (ids) { var options = {// stuff} return $.ajax(options) } archiveFolders(data).then(alert("heyo"));
但是在调用 archiveFolders 后,“heyo”会立即显示,而不是在调用完成后显示。如何等待显示“heyo”,直到我得到服务器的响应?
这个问题其实很简单。 alert("heyo")立即评估。试试这个:
alert("heyo")
archiveFolders(data).then(function () { alert("heyo"); });