Đây là mã tôi đang sử dụng là như sau xuống dưới đây:XDomainRequest trong IE là cho báo Access is denied lỗi
Tôi đang sử dụng IE9 và tôi không thể nhìn thấy yêu cầu được gửi trong tab Network. Tôi có tiêu đề Access-Control thiết lập trong JSP như:
<% response.setHeader("Access-Control-Allow-Origin", "*");%>
Mã để có được AJAX HTML Nội dung từ các JSP:
if ($.browser.msie && window.XDomainRequest) {
var xdr = new window.XDomainRequest();
xdr.open("GET", "http://dev01.org:11110/crs/qw/qw.jsp?&_=" + Math.random());
xdr.contentType = "text/plain";
xdr.timeout = 5000;
xdr.onerror = function() {
console.log('we have an error!');
}
xdr.onprogress = function() {
console.log('this sucks!');
};
xdr.ontimeout = function() {
console.log('it timed out!');
};
xdr.onopen = function() {
console.log('we open the xdomainrequest');
};
xdr.onload = function() {
alert(xdr.responseText);
};
xdr.send(null);
} else { ...... }
Tôi nhận được một báo Access is denied Lỗi. Bất kì sự trợ giúp nào đều được đánh giá cao!