为什么我的dojo xhr.post请求不起作用?

时间:2013-04-09 14:10:40

标签: javascript ajax post dojo xmlhttprequest

我有一个xhr post方法,但我的回调"alert("data retrieved")"永远不会被解雇,我不知道为什么。

这是一个更好阅读的小提琴: 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;
      })
};

招呼 汤姆

0 个答案:

没有答案
相关问题