Skip to content
This repository has been archived by the owner on Jun 29, 2019. It is now read-only.

maciejsmolinski/ie.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

IE.JS

Making Internet Explorer detection as simple as possible via global IE variable.

Sample Usage

  1. Simply detect IE
    if (IE) {
      console.log("You're using Internet Explorer");
    }
  1. Compare IE version
    if (IE < 8) {
      console.log("You're using outdated Internet Explorer. Please upgrade your browser");
    } else {
      console.log("Modern browser (including IE8+) is used!");
    }
  1. Check exact IE version
    // Correct
    if (IE && IE == 8) {
      console.log("You're using Internet Explorer 8!");
    }
    // Incorrect. This won't work. Details to be found in "Limitations" section below.
    if (IE && IE === 8) {
      console.log("You're using Internet Explorer 8!");
    }

global.IE variable might be an object (if Internet explorer is used) or undefined in case you're using modern, non-ie browsers.

Limitations

You can't use === in oder to detect IE version, == must be used. More details to be found here: http://sidekicksrc.com/post/the-value-of-valueof/

About

Making Internet Explorer detection as simple as possible via global `IE` variable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published