views:

49

answers:

1

IE 8 and Firebug's Javascript profiler both showed that jQuery each() spent a lot of time, but since the each() is not inside a function, there is no way to tell which line it is, and there are lots of these each() in the global scope of the source code. On Firebug, it can show you the file and line number, but it will take you to jQuery source code of each() without any call stack, so it is no use.

Is there a way to find out which each() it was?

+1  A: 

Google Chrome's Javascript console lets you take a snapshot of the stack under the "Profiling" tab.

The Scripts tab allows you to step through your scripts line by line.

alt text

Vincent McNabb
it says there it is a "Heap snapshot"?
動靜能量
Yes. Updating with screenshot...
Vincent McNabb
++ You shouldn't have to take many stackshots to see where the problem is. One might be enough.
Mike Dunlavey