为什么 IE 9 控制台返回语法错误,而 chrome 和 mozilla 控制台解析代码
var browserDetect={
init:function () {
this.Osystem()
this.browserFeatures()
},
Osystem:function () {
console.log(navigator.platform);
},
browserFeatures:function () {
if (navigator.appName=="Netscape") {
var Net=parseInt(navigator.appVersion);
console.log(Net)
}
else if (navigator.appName=="Microsoft Internet Explorer"){
var IE=parseInt(navigator.appVersion);
console.log(IE)
}
else{
console.log(navigator.appName)
}
},
};
browserDetect.init();
返回的错误是SCRIPT1028: Expected identifier, string or number line 22 character 1