views:

19

answers:

2

Hi

I am having a problem understanding which function runs (probably in infinite loop) in my JS code.

Is there a plug\way to see the list of the setTimeout functions that are running?

thank you

+1  A: 

You can probably use the Firebug Firefox extension to put a breakpoint in. http://getfirebug.com/

Matt Williamson
+1 Firebug ROCKS!!!!!
TheVillageIdiot
+1  A: 

All you have to do is hook into your setTimeout function and log stuff:

var _temp = setTimeout;
setTimeout = function() {
      _temp.apply(this, arguments);
      alert(arguments[0]);
};

Put that snippet at the top of your code. Every time anything invokes setTimeout, you'll see exactly who's doing it.

Also, instead of alert, use console.log or something similar.

David Titarenco