为什么多次请求的ajax数据不能push到数组里面?

var eugene = [];eugene[0] = 'aa';eugene[1] = 'bb';// console.log(modelkey);//遍历所有items,加上禁用for(var i = 1,len = allInput.length;i < len;i++){// allInput[i].setDisabled(true);if(allInput[i].disabled == false){newarr.push(allInput[i].value);}if(parseInt(allInput[i].value) === xmlType){if(allInput[i].disabled == true){allInput[i].setDisabled(false);console.log('加载异步请求');Ext.Ajax.request({url:"resources/xmlInsert.php",method:"GET",params: { file_name: fileName+'.xml', select_num: xmlType ,parent_file:filePath},success:function(response,opts){var xml = response.responseText;eugene.push('cc');console.log(eugene)console.log(xml);return insertKey.push(xml);console.log("成功,异步请求加载完成")// console.log(filePath);console.log(me);Ext.MessageBox.alert('成功','已经从服务器端获取结果');},failure:function(response,opts){Ext.MessageBox.alert("失败",'请求超时或网络故障,错误编号: ' + response.status);}});newarr.push(allInput[i].value);getModelKey(allInput,me);}else{Ext.MessageBox.alert("警告",'已经添加该模块');return;}}}


江城fen
浏览 1649回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript