var $div = $('div.demo'), data = $div.data(); // 获取所有绑定事件: var events = data.events; // 除了window对象绑定事件的比较特殊: var windowEvents = $(window).data('__events__');
var self = this; for ( var type in events ) { jQuery.each(events[ type ],function(idx,evt) { jQuery.event.add( self, type, evt.handler, evt.data ); }); }