I don't think that the hasEventListener plugin mentioned will handle custom events e.g.
var obj = {id:'test'};
$(obj).bind('custom', function(){
alert('custom');
}).trigger('custom');
alert($(obj).hasEventListener('custom'));
Also, at least in jQuery 1.5 I think you need to be careful using $(target).data('events') because it returns differently for events that have been bound to objects as above.
You need to do something like:
var events = $(target).data("events");
if(typeof events === "function"){
events = events.events;
}
I am using this sort of approach and it works but it feels a bit like I am at the mercy of jquery internals and that really I shouldn't be doing it!