serverSync plugin
$.fn.serverSync = function(option) { return this.each(function () { var $this = $(this); var data = $this.data('serverSync'); var options = typeof option == 'object' && option; if (!data) { data = new ServerSync(this, options); $this.data('serverSync', data); } if (typeof option == 'string') { data[option](); } }); };