not-for-ie
A mini-library to declare that your web application is not designed to run in Internet Explorer
Features
- Appends a specified CSS class to HTML body on activation
- Provides a method to detect IE
How to Use
Directly from a web page
One can use not-for-ie directly from a web-page by attaching the not-for-ie.js and not-for-ie.css to the DOM.
<!-- Attaching the not-for-ie script -->
<script type="text/javascript" src="path/to/library/not-for-ie.js"></script>
<!-- Usage -->
<script type="text/javascript">
notForIe.activate('ie');
</script>
Webpack, Browserify or RequireJS
WithInstall not-for-ie from NPM
npm install not-for-ie --save-dev
Consume as an ES6 module
import * as notForIe from 'not-for-ie';
or
import { isIe } from 'not-for-ie';
Consume as a CommonJS module
var notForIe = require('not-for-ie');
Consume as an AMD
require(['not-for-ie'], function (notForIe) {
// Consume notForIe
}
Note: You may have to use Babel for ES6 transpilation.
Methods
activate
Appends the specified CSS class to the HTML body
element.
notForIe.activate('ie');
isIe
Determines whether the application is known to be running within Internet Explorer.
if (notForIe.isIe()) {
// Running within IE
}
Demo
You can view a demo here.
To-do
- Write unit-tests