dkfr.net
当前位置:首页 >> js获取iE版本号 >>

js获取iE版本号

IE6~IE10的浏览器特征明显,存在msie字符串,而IE11去掉了msie字符串,可以通过rv后面的版本号识别IE11,具体方法如下: function IETester(userAgent){ var UA = userAgent || navigator.userAgent; if(/msie/i.test(UA)){ return UA.match(/ms...

function getExplorerInfo() { var explorer = window.navigator.userAgent.toLowerCase() ; //ie if (explorer.indexOf("msie") >= 0) { var ver=explorer.match(/msie ([\d.]+)/)[1]; return {type:"IE",version:ver}; } //firefox else if (e...

var browser=navigator.appName var b_version=navigator.appVersion var version=b_version.split(";"); var trim_Version=version[1].replace(/[ ]/g,""); if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") { alert("...

var isIE = function(ver){ var b = document.createElement('b') b.innerHTML = '' return b.getElementsByTagName('i').length === 1}alert('ie6:' + isIE(6) + '\n' + 'ie7:' + isIE(7) + '\n' + 'ie8:' + isIE(8) + '\n' + 'ie9:' + isIE(9)...

用js的Navigator对象 txt = "Browser CodeName: " + navigator.appCodeName + ""; txt+= "Browser Name: " + navigator.appName + ""; txt+= "Browser Version: " + navigator.appVersion + ""; txt+= "Cookies Enabled: " + navigator.cookieEn...

function getExplorerInfo() { var explorer = window.navigator.userAgent.toLowerCase() ; //ie if (explorer.indexOf("msie") >= 0) { var ver=explorer.match(/msie ([\d.]+)/)[1]; return {type:"IE",version:ver}; } //firefox else if (e...

var browser=navigator.appName var b_version=navigator.appVersion var version=b_version.split(";"); var trim_Version=version[1].replace(/[ ]/g,""); if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") { alert("...

测试if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE6.0" || navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace...

if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)){ alert('你是使用IE')}else if (navigator.userAgent.indexOf('Firefox') >= 0){ alert('你是使用Firefox')}else if (navigator.userAgent.ind...

如楼上所说,HTML判断不了,要用到JS,不过建议使用JS的jQuery框架,因为原生JS兼容性太差,jQuery代码: $(document).ready(function(){ var bro=$.browser; var binfo=""; if(bro.msie) {binfo="Microsoft Internet Explorer "+bro.version;} ...

网站首页 | 网站地图
All rights reserved Powered by www.dkfr.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com