服務器我有這樣的代碼:如何抑制SSL錯誤,當AJAX請求與無效證書
function newXMLHttpRequest() {
var xmlHttp;
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (f) {
xmlHttp = new XMLHttpRequest();
}
}
return xmlHttp;
}
var xmlHttp = newXMLHttpRequest();
xmlHttp.open("POST", url, true);
xmlHttp.onreadystatechange = function() {
// this I have xmlHttp.status = 12019
alert("readyState = " + xmlHttp.readyState + "\nstatus = " + xmlHttp.status);
}
xmlHttp.send('same data');
當我發送請求無效證書的服務器我有錯誤,狀態碼爲12019.
解決方案應該是跨瀏覽器(IE,FF,Chrome)