views:

35

answers:

2

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?

+1  A: 

Not trivially.

The events are executed in the order they are bound. You could unbind all events, bind yourEvent, then rebind all events though.

Konerak
A: 

Do something like this:

var fn = document.GetElementByID('x').clicked;
document.GetElementByID('x').clicked = function(){ 
  //action
  fn();
}

In Javascript the functions are function pointers.