sencha touch开发好的工程在电脑上运行正常,用官方的ryby工具压缩后电脑上无法运行,提示Uncaught TypeError: Cannot read property 'JsonP' of undefined ;
在工程中的众多store中都用到jsonp的访问方式,经过压缩后无法识别JsonP,不知道是否有大神知道解决办法?
答对50分送上,其中一个store的源码如下:
Ext.define("video.store.MenuStorej",{
extend:"Ext.data.Store",
requires:["video.model.MenuModel","Ext.data.Request",
"Ext.data.proxy.JsonP","Ext.data.JsonP"],
config:{
model:"video.model.MenuModel",
proxy: {
type: 'jsonp',
url: 'https://openapi.youku.com/v2/schemas/video/category.json',
reader: {
type: "json",
rootProperty: "categories"
}
},
listeners:{
beforeload:function( store, operation, eOpts ){
},
load:function( store, records, successful, operation, eOpts ){
}
}
}
});
参考:http://docs.sencha.com/touch/1.1.1/#!/guide/getting_started
http://www.sencha.com/forum/showthread.php?182938-jsonp-callback-method-undefined
楼上的URL是我遇到的问题,但没看到解决方法
问题详细描述:
压缩后的工程index.html文件中会被引入如下代码:
https://openapi.youku.com/v2/schemas/video/category.json?_dc=1418724685177&page=1&start=0&limit=25&callback=Ext.data.JsonP.callback1
就是这行代码报错的,提示:Uncaught TypeError: Cannot read property 'JsonP' of undefined