This is a micro-framework or a collection of small, helpful utilities for common javascript tasks.
- Source: 5147 bytes.
- Minified: 825 bytes
- Compressed: 241 bytes.
- see original
- Bind/Unbind events -
b();
- DOM selector -
d();
- Get cross-browser xhr -
j();
- Create DOM elements -
m();
- Local storage -
s();
- Templating -
t();
a
DOM Elementb
Event name
var el = document.getElementById('container');
b(el, 'click', function(e) {
console.log('clicked');
});
d('div');
d('#name');
d('.name');
a = j();
var el = m('<h1>Hello</h1>');
document.body.appendChild(el);
s(placeholder,JSON);
var hello = t("Hello, #{this.name || 'world'}!")
console.log( // => "Hello, Jed!"
hello({name: "Jed"})
)
Inspired by 140bytes.