GithubHelp home page GithubHelp logo

dom4's Introduction

DOM4

Now in cdnJS

Many thanks to cdnjs for hosting this script. Following an example on how to include it.

<script
  src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.1.0/dom4.js"
>/* DOM4 */</script>

Features

This is a fully tested and covered polyfill for both new DOM Level 4 parentNode entries:

  • Element#prepend()
  • Element#append()

And for new DOM Level 4 childNode entries:

  • Element#before()
  • Element#after()
  • Element#replace()
  • Element#remove()

The implemented test is conform to current specifications.

Other fixes/standardized behaviors include:

  • classList, with forced fixes for iOS 5.1 and Nokia ASHA Xpress Browser and early implementations
  • CustomEvent constructor for all browsers down to IE8
  • Element#matches utility to test elements against CSS selectors
  • Element#closest utility to find element inclusive ancestor via CSS selectors

The DOM4 license is Mit Style.

If you need other polyfills too have a look at another DOM-shim repo.

Compatibility

Theoretically compatible with all browsers you know that are truly used these days, here a list:

  • Android 2.1+
  • Safari Mobile since iOS 3.0 and Desktop
  • Opera Mobile, Mini, and Desktop
  • Blackberry 7.1 and higher
  • Samsung Bada 2 native Browser
  • Midori and most likely all other WebKit based
  • Chrome Mobile and Desktop
  • Firefox Mobile and Desktop
  • IE8+ for Desktop and IE Mobile 9 or greater.
  • Nokia Xpress Browser for ASHA Platform
  • Silk Browser - Fire OS 3.0
  • PhantomJS can benefit from DOM4 too

It's way easier if you tell me which browser in a current relevant market share is not supported :-)

For IE8 only it's recommended to include ie8 script before dom4 or CustomEvent, addEventListener, and dispatchEvent won't work as expected.

Which File

The minified version is here, while the max one here. If you want to test directly try this page, it should be green.

dom4's People

Contributors

webreflection avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.