Skip to content

Instantly share code, notes, and snippets.

@zhangskills
Created October 11, 2014 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhangskills/79e9772570dac24e669a to your computer and use it in GitHub Desktop.
Save zhangskills/79e9772570dac24e669a to your computer and use it in GitHub Desktop.
javascript相关
@zhangskills
Copy link
Author

判断IE版本号

var _IE = (function(){
    var v = 3, div = document.createElement('div'), all = div.getElementsByTagName('i');
    while (
        div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
        all[0]
    );
    return v > 4 ? v : false ;
}());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment