【发布时间】:2014-03-16 14:29:03
【问题描述】:
我有这个简单的函数,我从我的应用程序中调用 launch() 函数:
function ajaxCall(){
Ext.Ajax.request({
url: 'ajax/Hello!', // Request should go to host/ajax url as http get request
// and server should return plain text `Hello!` as answer
success: function(response){
prompt('Ajax call success!', response.responseText); // My own prompting method
}
});
}
问题是这个请求似乎没有被提出。它没有显示在我的 Play 框架服务器或 Google Chrome 的网络开发人员标签中。
编辑
程序似乎也卡在Ext.Ajax.request 函数上。
【问题讨论】:
-
尝试在 app.js 的 'require' 属性中添加“Ext.Ajax”。
-
你是在launch里面调用ajaxCall()吗?
-
是的,我从我的 launch() 方法中调用该方法。
-
你的sencha在你服务器的同一个域上吗? sencha ajax 无法运行或跨域(需要使用 jsonp)。
-
这很奇怪。你的提示叫什么?你能在 chrome 网络上查看申请吗?
标签: javascript ajax http sencha-touch sencha-touch-2