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”事件从未被解雇过.感谢任何帮助,谢谢.
解决方法 这听起来像跨域请求问题. qx.io.remote.Request使用XHR来传输由于浏览器限制而在每种情况下都不起作用的数据.将请求上的crossDomain标志切换为true将从XHR更改为动态插入的脚本标记没有跨域限制(但其他限制).req.setCrossDomain(true);
也许这解决了你的问题.
此外,您还可以查看远程包的文档以获取有关跨域请求的更多详细信息:
http://demo.qooxdoo.org/current/apiviewer/#qx.io.remote
另外注意不要两次使用请求对象.唯一的工作一次.
总结以上是内存溢出为你收集整理的Web服务 – 使用Qooxdoo从Web服务获取数据时出现问题全部内容,希望文章能够帮你解决Web服务 – 使用Qooxdoo从Web服务获取数据时出现问题所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)