请不要使用“ for循环”。而是在成功回调中增加计数器并重新触发自身。像下面这样。
function mySyncFunction (counter, totRecords){ if(counter === undefined) counter = 0; if(counter >=totRecords) return; var defectssurl = 'https://test.com/mywcf.svc/GetListAllPaging?id=' + counter; Ext.Ajax.request({ url:defectssurl, // snip // your pre here success: function (resp) { // snip // your pre here counter++; mySyncFunction(counter, totRecords); } // snip // your pre here});


