Ajax调用HTTPS。 Android PhoneGap XHR状态= 0

时间:2011-10-11 12:00:08

标签: javascript android

我想通过HTTP对HTTPS进行AJAX调用,但是XHR.status=0

我使用以下代码进行调用:

   $j.ajax({
        type: method || "GET",
        async: this.asyncAjax,
        url: url,
        contentType: 'application/json',
        cache: false,
        processData: false,
        data: payload,
        success: function(response){
                alert("Resp");

},
       error: function(xhr, status, error) {
       alert("3-"+xhr.status+" STATUS: "+status+" ERROR: "+error+" URL: "+url);
    },
        dataType: "json",
        beforeSend: function(xhr) {
            if (that.proxyUrl !== null) {
                xhr.setRequestHeader('SalesforceProxy-Endpoint', url);
            }
            xhr.setRequestHeader(that.authzHeader, "OAuth " + that.sessionId);
            xhr.setRequestHeader('X-User-Agent', 'salesforce-toolkit-rest-javascript/' + that.apiVersion);
        }
    });

}

0 个答案:

没有答案