In one section of code I have this:
$("#searchbar").trigger("onOptionsApplied");
In another section of code, I have this:
$("#searchbar").bind("onOptionsApplied", function () {
alert("fdafds");
});
The bind()
is executed before the trigger()
, but when I view the page, I never get an alert()
.
Why not? What am I doing wrong with events?