3

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?

Konerak
  • 38,301
  • 12
  • 96
  • 116
Jeremy
  • 43,100
  • 64
  • 198
  • 320
  • see http://stackoverflow.com/questions/2360655/jquery-event-handlers-always-execute-in-order-they-were-bound-any-way-around-th/2641047#2641047 – Anurag Jun 22 '10 at 06:13

2 Answers2

0

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
  • 38,301
  • 12
  • 96
  • 116
0

Do something like this:

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

In Javascript the functions are function pointers.

sth
  • 211,504
  • 50
  • 270
  • 362
user368038
  • 273
  • 1
  • 5
  • 16