方法如下
GetAllIndustry().then(function(Industry){
alert(Industry.length);
});这样写出来在另外一个页面上能够成功得到其length为10,可到了需要的页面就直接跳过了
想问一下这是什么情况?如何解决呢?jQuery函数
GetAllIndustry().then(function(Industry){
alert(Industry.length);
});这样写出来在另外一个页面上能够成功得到其length为10,可到了需要的页面就直接跳过了
想问一下这是什么情况?如何解决呢?jQuery函数
原方法为
GetAllIndustry().then(function(Industry){
alert(Industry.length);
if(Industry==null || Industry.length<=0){
//no Industry found
$("#Industry").html('<option value="0">None</option>');
}
else{
$("#Industry").html('<option value="0">None</option>'
+$("#tmplIndustry").render(Industry));
}
});能进入GetAllIndustry()方法、其中resolve(list) list.length为10 方法返回 Deeferred.promise();在其他页面可以执行该方法,能得出Industry的length为10、课时这个页面不行、始终不知道是什么原因
解决了、原来是因为多个Deefer的返回问题