views:

40

answers:

2

suppose I look at a webpage and I see something like: MysteriousClass mc = new MysteriousClass(); mc.CallMysteriousMethod()

Now, the problem is that there are a zillion javascript files included into this page, and how am I supposed to find the one file that contains definition of this MysteriousClass? I know that this could be dealt with using a spider and grep and things like that, but is there a professional and elegant way to do this?

Clarification: yeah, so I would like to do it statically, without debugging. So Firebug is the right way to go?

As far as IDE go, which IDE should I use? Are there IDEs that will automatically download a website with all of its javascript dependencies and then allow static searches for methods and classes?

+5  A: 

Firebug plugin of Firefox can help. Place a break point where mysterious method is called and follow the code flow.

Cem Kalyoncu
+1 on firebug the most easy I think
RageZ
firebug is very good at providing links to functions as well if you're in the DOM view, or even just ctrl+f
annakata
+3  A: 

What's unprofessional about grep?

grep -R "function CallMysteriousMethod" *

or similar.

Or maybe just use a modern IDE which will sort this all out for you.

timdev
don't forget it can be CallMysteriousMethod = function() { ....
Cem Kalyoncu
I think he meant professional = automated tool
alex
Professionals use simple tools, pipes, and io redirection, dag-nab-it!
timdev