Skip to content
Browse files

Create a bound version

  • Loading branch information...
1 parent 598db13 commit a2ab57a3df8b239ec281e94df9130617f6759e07 @RobertFischer committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 jquery.periodicalupdater.js
View
9 jquery.periodicalupdater.js
@@ -19,6 +19,7 @@
var included_cookies = false; // Has the cookies script loaded? (i.e. it's safe to call $.cookie)
if($.cookie) included_cookies = true;
+ // The free version
$.PeriodicalUpdater = function(url, options, callback){
if(!options) options = {};
var settings = jQuery.extend(true, {
@@ -256,4 +257,12 @@
return handle;
};
+
+ // The bound version
+ $.fn.PeriodicalUpdater = function(url, options, callback) {
+ var me = this;
+ return $.PeriodicalUpdater(url, options, function() {
+ return callback.apply(me, arguments);
+ });
+ };
})(jQuery);

0 comments on commit a2ab57a

Please sign in to comment.
Something went wrong with that request. Please try again.