JavaScript Library for DOM manipulation in modern browsers with jQuery-compatible API.
Replacement jQuery for Backbone in browsers (2kb gzipped)
Get it
$ bower install jbone --save
Add a <script>
element for jbone.js
<script src="path/to/jbone/dist/jbone.js"></script>
var $input = $("<input>", {
"class": "name"
}).val('John');
$input.on("click.space", function(e) {
console.log("clicked on", this);
});
$input.trigger("click");
$input.off(".space");
This part is not covered on jBone. Yuo can select one of a huge amount implementations AJAX and Promises/A+.
For example: when, Q, simply-deferred, AJAX.
Example AJAX connecting:
// connect reqwest on your page https://rawgithub.com/ded/reqwest/master/reqwest.min.js
jBone.ajax = reqwest.compat;
$.ajax({
url: "example.com"
});
Example Deffered connecting:
// connect simply-deferred on your page https://rawgithub.com/sudhirj/simply-deferred/master/deferred.min.js
Deferred.installInto(jBone);
var deferred = $.Deferred();
$.when(deferred).then(function(response) {
// some code
});
- jBone(selector[, context])
- jBone(element)
- jBone(elementArray)
- jBone(jBoneObject)
- jBone(html[, attributes])
- .attr(attributeName)
- .attr(attributeName, value)
- .attr(attributes)
- .val()
- .val(value)
- .css(propertyName, value)
- .css(properties)
- .on(event[, selector], handler)
- .one(event[, selector], handler)
- .off(event[, handler])
- .trigger(event)
- jBone.merge(first, second)
- jBone.contains(container, contained)
- jBone.extend(target[, object1][, objectN])
- .pop()
- .push()
- .reverse()
- .shift()
- .sort()
- .splice()
- .unshift()
- .concat()
- .join()
- .slice()
- .indexOf()
- .lastIndexOf()
- .forEach()
- .every()
- .some()
- .filter()
- .map()
- .reduce()
- .reduceRight()
npm install
npm test
npm install
- Open page with tests in browser
test/tests.html