Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 3rd, 2012  |  syntax: None  |  size: 0.37 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
  2.  * http://benalman.com/
  3.  * Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
  4.  
  5. (function($) {
  6.  
  7.   var o = $({});
  8.  
  9.   $.subscribe = function() {
  10.     o.on.apply(o, arguments);
  11.   };
  12.  
  13.   $.unsubscribe = function() {
  14.     o.off.apply(o, arguments);
  15.   };
  16.  
  17.   $.publish = function() {
  18.     o.trigger.apply(o, arguments);
  19.   };
  20.  
  21. }(jQuery));