jQuery Roundup: Joconut, jQuery Table Sort, jQuery.pushevent
Joconut
Joconut (License: MIT) by Vadim Demedes is an alternative implementation of Chris Wanstrath’s pjax plugin. Joconut is about 1K smaller (I compared them both gzipped and minified myself), and it also loads JavaScript and CSS automatically.
Adding Joconut to a page will cause requests to the current host to load using $.ajax. To maintain history, it uses history.pushState, and degrades to onhashchange. Several internal events can be bound to, which is useful for things like error handling:
$.joconut.on('error', function() {
alert('Error while loading new page!');
});
Stupid jQuery Table Sort
Stupid jQuery Table Sort (GitHub: joequery / Stupid-Table-Plugin, License: MIT) by Joseph McCullough is a simple table sorting plugin based around Array.prototype.sort:
As long as you understand basic JavaScript sorting, you can make this plugin do as much or as little as you want.
Callbacks can be supplied for custom sorting based on type. In Joseph’s example, he’s set a th class of type-date, then passed in a date callback:
$('#complexTable').stupidtable({
'date': function(a,b) {
jQuery.pushevent
jQuery.pushevent (License: GPL) by “yeikos” helps manage the order events will be fired. This example causes the order of the events to be swapped:
$('button').on('click.first', function() {
alert('1');
}).on('click.second', function() {
alert(2);
}).pushEvent('click.second');
The author also sent in two more plugins:
- jQuery.placeholder – A
placeholderattribute implementation - jQuery.unparam – Uses
decodeURIComponentto convert URL param strings into objects
