I'm using jQuery to add a blur event to a text box. I would like开发者_运维知识库 my event to fire before any other existing events. Is this possible to do?
Not trivially.
The events are executed in the order they are bound. You could unbind all events, bind yourEvent, then rebind all events though.
Do something like this:
var fn = document.GetElementByID('x').clicked;
document.GetElementByID('x').clicked = function(){
//action
fn();
}
In Javascript the functions are function pointers.
精彩评论