我有这个代码:
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');
Run Code Online (Sandbox Code Playgroud)
当我向服务器发送无效证书的请求时,我的错误状态代码为12019.
解决方案应该是跨浏览器(IE,FF,Chrome)
我试图在JavaScript中引用函数来混淆源代码
var g = document.getElementById;
Run Code Online (Sandbox Code Playgroud)
但是该通话g('id')会导致Google Chrome出错TypeError: Illegal invocation