1
我在這裏傳遞一個HTTP請求頭值通過jquery的AJAX call..It與IE僅工作和Firefox.The不工作AJAX調用本身在Firefox是沒有發生時xhr.setRequestHeader
是存在於代碼xhr.setRequestHeader在Firefox中不工作,但在IE中工作?
var Call = function() {
$.support.cors = true;
var input = {
RefId: "111", LoginId: "222", Id: "33", FirstName: "aaa", LastName: "bbb"
};
var url = document.URL;
$.ajax({
type: "POST",
beforeSend: function (xhr) {
xhr.setRequestHeader("URL", url);
},
url: "http://localhost:40780/Service.svc/Insertion",
data: JSON.stringify(Input),
contentType: "application/json",
dataType: "json",
success: function (response) {
alert(response);
},
error: function (xhr, status, error) {
}
});
}
有什麼建議嗎?