我在Sencha Touch中有一个视图,其中我使用Ajax请求使用外部html文件。视图的代码如下:
Ext.define('Appname.view.Viewname', {
extend: 'Ext.Container',
xtype: 'viewname',
initialize : function () {
this.callParent();
Ext.Ajax.request({
url : 'resources/hello.html',
params : {
id : 1
},
scope : this,
success : function (response) {
var text = response.responseText;
this.setHtml(text);
}
})
rotate();
}
});我正在试图在视图名视图中加载hello.html。当我在浏览器中运行应用程序时,它工作正常。一旦我使用cordova将它部署到我的平板电脑上,它就不会显示任何东西。原因是什么??
发布于 2014-02-12 22:11:38
如果部署在android设备上,请检查eclipse项目中的hello.html是否存在于“assets/www/resources”文件夹中。如果没有,复制然后尝试为你的android设备创建apk .
https://stackoverflow.com/questions/21721787
复制相似问题