检测 IE 版本 in Javascript

来源:互联网 发布:淘宝拉芙菲尔被曝光 编辑:程序博客网 时间:2024/06/05 02:27


点击打开链接http://stackoverflow.com/questions/10964966/detect-ie-version-in-javascript


<!doctype html><!--[if lt IE 7 ]> <html class="ie6"> <![endif]--><!--[if IE 7 ]>    <html class="ie7"> <![endif]--><!--[if IE 8 ]>    <html class="ie8"> <![endif]--><!--[if IE 9 ]>    <html class="ie9"> <![endif]--><!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]--><head>


(function ($) {    "use strict";    // Detecting IE    var oldIE;    if ($('html').is('.ie6, .ie7, .ie8')) {        oldIE = true;    }    if (oldIE) {        // Here's your JS for IE..    } else {        // ..And here's the full-fat code for everyone else    }}(jQuery));


0 0
原创粉丝点击