https://github.com/myterminal/not-for-ie
A mini-library to declare that your web application is not designed to run in Internet Explorer
https://github.com/myterminal/not-for-ie
cross-browser web-application
Last synced: 30 days ago
JSON representation
A mini-library to declare that your web application is not designed to run in Internet Explorer
- Host: GitHub
- URL: https://github.com/myterminal/not-for-ie
- Owner: myTerminal
- License: mit
- Created: 2018-06-07T16:26:42.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-08-19T04:53:54.000Z (almost 4 years ago)
- Last Synced: 2025-02-18T10:43:44.632Z (over 1 year ago)
- Topics: cross-browser, web-application
- Language: JavaScript
- Homepage:
- Size: 166 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# not-for-ie
[](https://badge.fury.io/js/not-for-ie)
[](https://www.npmjs.com/package/not-for-ie)
[](https://opensource.org/licenses/MIT)
[](https://travis-ci.org/myTerminal/not-for-ie)
[](https://codeclimate.com/github/myTerminal/not-for-ie)
[](https://www.npmjs.com/package/eslint-config/myterminal)
[](https://coveralls.io/r/myTerminal/not-for-ie?branch=master)
[](https://nodei.co/npm/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.
notForIe.activate('ie');
### With [Webpack](https://webpack.js.org), [Browserify](http://browserify.org) or [RequireJS](http://requirejs.org)
Install *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](https://babeljs.io) 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](https://myterminal.github.io/not-for-ie/examples).
## To-do
* Write unit-tests