我的首席團隊決定使用Qooxdoo作爲我們項目的前端。我們正在爲使用NOX的OpenFlow控制器開發應用程序,所以我們使用NOX webservices框架。我無法從服務獲取數據;我知道該服務正在運行,因爲如果我使用Firefox訪問URL,則會顯示正確的數據。這裏是我的代碼的相關部分:使用Qooxdoo從Web服務獲取數據時遇到問題
var req = new qx.io.remote.Request("http://localhost/ws.v1/hello/world",
"GET", "text/plain");
req.addListener("complete", function(e) {
this.debug(e.getContent());
});
var get = new qx.ui.form.Button("get");
get.addListener("execute", function() {
alert("The button has been pressed");
req.send();
}, this);
form.addButton(get);
在Firebug控制檯後,我通過點擊提醒我得到這個消息:
008402 qx.io.remote.Exchange: Unknown status code: 0 (4)
如果我再次按下獲取按鈕,我得到這個錯誤:
027033 qx.io.remote.transport.XmlHttp[56]: Failed with exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: file:///home/user/qooxdoo-1.0-sdk/framework/source/class/qx/io/remote/transport/XmlHttp.js :: anonymous :: line 279" data: no]
我也看了Twitter客戶端的教程,但是「dataChange」事件中,我在的地方從來沒有發射的「tweetsChanged」事件的成立。任何幫助表示讚賞,謝謝。
謝謝!這是一個跨域問題,所以我必須獲取由我們的NOX應用程序提供的Qooxdoo應用程序,然後關閉緩存預防機制,以便不會有任何查詢字符串附加到請求中。 (我想我可以嘗試從服務器端修復它,但是如果我找到它,我會燒掉那座橋)。無論如何,它現在正在工作! – Andy 2010-03-07 01:36:24