anon
anon

Reputation:

how can I find a referenced Javascript method in a big website?

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?

Upvotes: 1

Views: 59

Answers (2)

timdev
timdev

Reputation: 62894

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.

Upvotes: 3

Cem Kalyoncu
Cem Kalyoncu

Reputation: 14593

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

Upvotes: 5

Related Questions