js的一些代码

}
function getStringLen(b) {
var a = b.match(/[^\x00-\xff]/ig);
return b.length + (a == null ? 0 : a.length)
}
function getBrowserType() {
var a = 0;
if (window.ActiveXObject) {
if (window.XMLHttpRequest && !window.XDomainRequest) {
return 5
} else {
if (window.XDomainRequest) {
return 6
} else {
return 1
}
}
} else {
if (typeof (Components) == "object") {
a = 2
} else {
if (typeof (window.opera) == "object") {
a = 3
} else {
if (window.MessageEvent && !document.getBoxObjectFor) {
a = 7
} else {
if (navigator.appVersion.indexOf("Safari") >= 0) {
a = 4
}
}
}
}
}
return a
}
function checkCookieEnabled() {
try {
if (navigator.cookieEnabled == false) {
return false
}
} catch (a) {}
return true
}

原文地址:https://www.cnblogs.com/yanypan/p/2776742.html