[jQuery] Custom data property in custom events
Hi,
when triggering a custom event with some custom data, all my data is
removed from the data-property on the event object. It's only
available in the data parameter sent as the second parameter to the
event handler. Even though I've created a custom event object and
populated the data-property. Is this by design or is it a bug?
$(document).bind("hepp", function(e, data) {
alert(data.test + " -- " + (!e.data ? "<undefined>" : e.data.test));
});
$(function() {
$(document).trigger("hepp", { test: "hopp" });
});
This always alerts "hopp -- <undefined>".
Thanks,
Glenn