js代码如下:
function loadDate() { var dtd = $.Deferred(); $.ajax({ type: "POST", url: args.url, async: true, dataType: "json", data: args.data, success: function(res){ dtd.resolve(); } }); return dtd.promise(); } $.when(loadDate()) .done(function() { console.log(‘加载成功!‘); }) .fail(function() { console.log(‘加载失败!‘); })
时间: 2024-10-05 22:39:59