我正在尝试使用Qooxdoo对CouchDB进行AJAX调用,但据我所知,没有事件似乎在我的请求对象上触发(即没有任何事件出现在控制台上,并且没有警报出现)。任何人都可以告诉我应该发生什么/我做错了什么?Qooxdoo AJAX帮助 - 事件不起作用?
(这是所有在我班上的“主”方法)
var req = new qx.io.remote.Request('http://localhost:5984/japanese/words', 'GET', 'application/json').set({crossDomain:true,timeout:0});
this.debug("Testing");
req.addListener("created", function(e) {
this.debug("Created");
alert(e.getContent());
}, this);
req.addListener("sending", function(e) {
this.debug("Configured");
alert(e.getContent());
}, this);
...
(这只是一个样本 - 我添加了一个类似的监听所有我能想到的,但没有什么是事件即将在控制台上)
我的服务器运行Ubuntu 10.10与Qooxdoo 1.3。
编辑:
现在试图请求 “HTTP://localhost/languages/test.php”(我的应用程序是在 “HTTP://localhost/languages/index.html”),仍然没有警报除了我在任何事件之外放置的测试外,都出现了。我的要求是:new qx.io.remote.Request('http://localhost/languages/test.php', 'GET', 'application/json');
当我在浏览器中访问PHP文件时,PHP文件返回有效的JSON。当然这应该工作?
只是要在安全方面(你的样品不显示)...你居然叫在代码中
send()
方法? – trkoch 2011-04-12 05:28:52