https://github.com/caub/dom-polyfills
polyfills for old browsers DOM api, experimental, consider something more robust like polyfill.io
https://github.com/caub/dom-polyfills
Last synced: over 1 year ago
JSON representation
polyfills for old browsers DOM api, experimental, consider something more robust like polyfill.io
- Host: GitHub
- URL: https://github.com/caub/dom-polyfills
- Owner: caub
- Created: 2017-04-24T09:42:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-24T10:55:46.000Z (about 9 years ago)
- Last Synced: 2025-02-28T22:20:40.150Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## DOM polyfills
- fetch
- URLSearchParams
- Element#classList
- Element#dataset
- Element#matches
- Element#closest
Must be included after es6-shim (it uses Promises and Map)
### usage:
```js
if (!Array.hasOwnProperty('from'))
addScript('https://unpkg.com/es6-shim@latest/es6-shim.min.js'); // or use your own server
if (!window.hasOwnProperty('URLSearchParams'))
addScript('https://unpkg.com/dom-polyfills@latest/polyfills.js');
function addScript(src) {
var script = document.createElement('script');
script.src = src;
document.body.appendChild(script);
}
```
todo tests