In IE, you can use the debugger; keyword debugger; . Not sure about the convenience of the x-browser:
function sayHello() { debugger;
In the context of your task:
function someKeyPress(e) { debugger;
I believe this is the most efficient debugging method, but again I spend a lot of time in IE. Many people are comfortable with Firebug, but I find it cumbersome and much less intuitive than the IE debugger. The IE debugger provides easier monitoring of clocks and expressions, and also provides interactive reflection hints (such as the VS debugger).
Also, in your question โtrack which method was calledโ, the call stack is very responsive and easily tracks back / up.
UPDATE:
Here's a script to place traps and debug events at the bottom of each page, in IE:
<script type="text/javascript"> function wrapIfHandled(el, evt) { if (el && evt && el['on' + evt]) { el['_on' + evt] = el['on' + evt]; el['on' + evt] = function (e) { foo(e, el['_on' + evt]); }; } } function wrapAll() { var allEl = document.getElementsByTagName("*"); for (var i = 0; i < allEl.length; i++) { wrapIfHandled(allEl[i], 'click'); </script>
Brian
source share