0
其中i有放置在POST方法Ajax中的頁眉和XMHttp請求等在ajax XMLHttp請求中查找標題?
例如: headers.put("X-PAYPAL-SECURITY-USERID", "tok261_biz_api.abc.com"); headers.put("X-PAYPAL-SECURITY-PASSWORD","1244612379");
的Ajax:
$.ajax({
type:'POST',
url:'url',
data: dataobject,
cache:false,
dataType:'json',
success:onSuccess,
error:function(xhr,ajaxOptions){
alert(xhr.status + " :: " + xhr.statusText);
}
});
的XMLHTTP:
var http = new XMLHttpRequest();
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}