Why doesn't my dojo xhr.post request work?

我的未来我决定 提交于 2019-12-12 02:59:58

问题


I have an xhr post method, but my callback with "alert("data retrieved")" never gets fired and I dont know why.

Here is a fiddle for better reading: http://jsfiddle.net/ZKppc/1/

appPrototype.prototype.requestData = function(url, user, password) {
    var me = this;
    document.getElementById("inputServer").value = url;
    this.definedUrl = url;
    dojo.xhr(
       "http://" + url + "x/y.json",
       {
          handleAs: "json",
          method: "POST",
          data: {
            l_username: user,
            l_password: password},
            preventCache: true
       }).then(function(data) {
        alert("data retrieved");
       },
       function(err){
           me._handleInitError_p(error);
           return error;
      })
};

greets Tom

来源:https://stackoverflow.com/questions/15904255/why-doesnt-my-dojo-xhr-post-request-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!