Hi @all,
i'm still trying out the possibilities from the qx-communications and i
handle now with the httpRequests.
so i developed a small app and in the IE its running without Problems. But
trying it in Firefox,Opera,Chrome and even Safari there's always the same
error: The "success" and the "fail" listeners are both called and i got as
Http status code "200". But the response is everytime null.
Did i missed something in the docu or the API?
here's my code:
----------------------------------------
qx.Class.define("qxwebservice.Application",
{
extend : qx.application.Standalone,
members :
{
main : function()
{
this.base(arguments);
if (qx.core.Environment.get("qx.debug"))
{
qx.log.appender.Native;
qx.log.appender.Console;
}
var doc = this.getRoot();
doc.add(this.createWidgets())
},
createWidgets : function() {
var layout = new qx.ui.layout.Grid()
var container = new qx.ui.container.Composite(layout)
container.setPadding(5)
layout.setSpacing(10)
var label1 = new qx.ui.basic.Label("HTTP requests")
container.add(label1, {row :0, column: 0})
var input1 = new qx.ui.form.TextField(null)
input1.setPlaceholder("input")
container.add(input1, {row :1, column: 0})
var output = new qx.ui.form.TextArea(null)
output.setWidth(200);
output.setPlaceholder("result")
container.add(output, {row : 0,column : 1,rowSpan:2})
var btnr0 = new qx.ui.form.Button("Call GET")
container.add(btnr0, {row : 2,column : 0})
var btnr1 = new qx.ui.form.Button("Call POST")
container.add(btnr1, {row : 2,column : 1})
var reqGET = new qx.io.request.Xhr()
reqGET.setUrl("http://www.w3schools.com/ajax/demo_get2.asp");
reqGET.setMethod("GET")
reqGET.setAsync(true)
btnr0.addListener("execute", function() {
reqGET.setRequestData({"fname":
input1.getValue()})
reqGET.send();
})
reqGET.addListener("fail", function(e) {
var req = e.getTarget()
var response = req.getResponse()
alert("fail "+response+". Code:
"+req.getStatus())
}, this);
reqGET.addListener("success", function(e) {
var req = e.getTarget()
var response = req.getResponse()
alert("success "+response+".")
}, this);
reqGET.bind("response", output, "value")
return container
}
}
});
----------------------------------------
thanks for your help,
best regards
pascal
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/Known-issue-with-request-Xhr-and-browsers-tp7000300p7000300.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel