我正在爲iOS和Android平臺構建PhoneGap - Sencha-touch應用程序。我使用Ext.Ajax.request()函數加載本地.js文件。Ext.Ajax.request()在成功請求時調用失敗回調函數
有趣的事情發生 - 請求成功,但'失敗'回調被稱爲。 下面是代碼:
Ext.Ajax.request({
url: 'localfolder/foo.js',
success : function(xhr){
// not invoked
},
failure : function(response, options){
// response.status == 0
// wtf, response.responseText contains exactly the contents of the local .js file!
}
});
任何人有一個想法,爲什麼的時候,其實要求succedded的「失敗」觸發回調? 更重要的是,我如何讓'成功'回調被觸發呢?
什麼response.status? – chrixian
response.status == 0(我編輯了問題並添加了這個信息) – gardenofwine