我想通过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);
}
});
}