Live extension playground
Pull request Compare This branch is 734 commits behind chemerisuk:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
extra
src
test
.gitignore
.jshintrc
.travis.yml
Gruntfile.js
LICENSE.txt
README.md
bower.json
main.sublime-project
package.json

README.md

better-dom Build Status

Live extension playground

API DOCUMENTATION

Features

Performance

Installation

The simplest way is to use bower:

bower install better-dom --save

This will clone the latest version of the better-dom with dependencies into the bower_components directory at the root of your project. Then just include scripts below on your web page:

<!DOCTYPE html>
<html>
<head>
    ...
    <!--[if IE]>
        <link href="bower_components/better-dom/dist/better-dom.htc" rel="htc"/>
        <script src="bower_components/html5shiv/dist/html5shiv.js"></script>
    <![endif]-->
</head>
<body>
    ...
    <script src="bower_components/better-dom/dist/better-dom.js"></script>
</body>
</html>

Usage examples

Notes about old IEs

For IE8-9 support you have to incude conditional comment above into head. The excellent html5shiv library is used to fix the HTML5 elements bug in legacy browsers and the HTC file helps to implement live extensions support.

Setup content-type header

HTC behaviors have to serve up with a content-type header of “text/x-component”, otherwise IE will simply ignore the file. Many web servers are preconfigured with the correct content-type, but others are not.

AddType text/x-component .htc

Same domain limitation

IE requires that the HTC file must be in the same domain with as the HTML page which uses it. If you try to load the behavior from a different domain, you will get an “Access Denied” error.

Browser support

  • Chrome
  • Safari 5.2.2+
  • Firefox 16+
  • Opera 12.10+
  • IE8+