判断浏览器 IE 11
var getOs=function()
{
try
{
var u = window.navigator.userAgent.toLocaleLowerCase(),
msie = /(msie) ([\d.]+)/,
chrome = /(chrome)\/([\d.]+)/,
firefox = /(firefox)\/([\d.]+)/,
safari = /(safari)\/([\d.]+)/,
opera = /(opera)\/([\d.]+)/,
ie11 = /(trident)\/([\d.]+)/,
b = u.match(msie)||u.match(chrome)||u.match(firefox)||u.match(safari)||u.match(opera)||u.match(ie11);
if(b[1].indexOf("msie")==0||b[1].indexOf("trident")==0)
{
return 1;
}
return 0;
}
catch(e)
{
return 0;
}
}