views:

4712

answers:

2

In Firefox I can get the stack trace of an exception by using exception.stack.

Is there a way to get that in other browsers, too?

Edit: I actually want to save the stack trace automatically (if possible) and not debug it at the time (i.e. I know how to get the stack trace in a debugger).

A: 

Not really, at least not easily.

In IE, you can debug the browser process with MS Script Debugger (which for some reason is an Office component) or Visual Studio, and then you can see the stack on breakpoints.

levik
+8  A: 

You can't get the same level of detail in all browsers, but it's better than nothing:

http://eriwen.com/javascript/js-stack-trace/

insin
If you use this printStackTrace() function in window.onerror, then it is perfect! upvote!
Daniel Silveira
Glad you like it :) - suggestions welcome.
Eric Wendelin