尝试使用返回的Promise接口:
function getGeneral(pid) { return $.ajax({ url: "/api/general", contentType: "text/json", dataType: "json", type: "GET", data: { id: pid } });}getGeneral("@Model.Id").done(function (item) { var p = new GeneralModel(); p = ko.mapping.fromJS(item); ko.applyBindings(p, document.getElementById("pv-portfolio-general-tab"));}).fail(function () { //handle error here});


