Is it possible to break on next event in IE10?
I'm working on a project that I haven't been with since the beginning so I don't know the code base very well yet. There seems to be an event on a textbox that runs on blur but I can't find it in the code at all. I'm hoping that IE has the debugger feature where it can break when a particular type of event has been triggered (in my case, the next blur to happen). Or is there a way to get a list of events on an input control?
You can pause script execution in Internet Explorer 10's Developer Tools. This will cause the execution to stop immediately just before the next script is ran. You can then step through execution to target the logic you're hunting for.
Alternatively, if you're binding events with jQuery you can tap into $._data and identify all of the bound events for any given element. For instance, suppose we had an input element that was behaving oddly, we could determine all bound events like this:
// We need a reference to the element, not a jQuery collection var firstname = $("#firstname"); // Next we pass the element as a reference console.log( $._data( firstname ) );
This returns the full data object for that particular element. On this resulting object will be an events collection showing all events handled, as well as the handlers ran when those events are raised.
Hope this helps.