我正在嘗試使用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