vardfd=$.Deferred();//第一步setTimeout(function(){dfd.resolve(10);},1000);//第二步等待第一步返回后執行dfd.then(function(data){console.log('Step1Result:'+data);//第一步的結果10returnsetTimeout(function(){returndata*data;//第二步的結果100這里如何將100返回到第三步能用},1000);})//第三步等待第二部返回的結果執行.then(function(data){console.log('Step2Result:'+data);//這里如何獲取第二步的結果?})
jquery的$.Deferred()多步驟調用問題
江戶川亂折騰
2019-04-14 11:19:11