Skip to content

Instantly share code, notes, and snippets.

@bga
Created July 19, 2010 15:40
Show Gist options
  • Save bga/481567 to your computer and use it in GitHub Desktop.
Save bga/481567 to your computer and use it in GitHub Desktop.
jQuery.fn.hasBind = function(type, _fn)
{
var data, eventsMap, events;
if(!((data = this._data()) && (eventsMap = data.events) && (events = eventsMap[type])))
return false;
var event, i = -1; while((event = events[++i]) && event.handler !== _fn)
;
return !!event;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment