An open API service indexing awesome lists of open source software.

https://github.com/regular/subdom

subdom component. wraps component/dom to isolate a sub dom, sort of chroot. Useful for widgets.
https://github.com/regular/subdom

Last synced: 10 months ago
JSON representation

subdom component. wraps component/dom to isolate a sub dom, sort of chroot. Useful for widgets.

Awesome Lists containing this project

README

          

# subdom

wraps component/dom to isolate a sub branch of the dom, sort of chroot. Useful for widgets

## Installation

$ component install regular/subdom

## API

This HTML contains two sub doms named `foo` and `bar`



title goes here




title goes here



A widget-like component can now create an instance of
component/dom that will only access elements of the named subdom.

mySubDom = require("subdom")("foo");

mySubDom(function(dom) {
dom("h1").html("Foo title"); // only changes h1 in scope 'foo'
});

## License

MIT