views:

51

answers:

3

Can someone tell me how I can get a call trace between different javascripts?

Suppose I have an html page that loads some javascript files, which in turn may load other javascript files from the server. Is there a way that I can trace which js page is loaded from what other js pages?

I've used google chrome speed tracer extension, and can get the event trace of the browser, normally javascript evaluation events were registered, but not all of the registered events have the attribute specifying what other script triggered the evaluation.

I've also used firebug, but it seems it's more useful in debugging javascripts instead of what I want.

Thanks.

A: 

What do you mean by 'load other javascript files'?

The standard way of loading a JavaScript file is to add the <script src="file.js"></script> tag to the HTML page.

The fastest way to understand what files are being loaded is to go through the code and look for anything that does some sort of <script> tag creation.

Luca Matteis
A: 

Thanks for the reply. and sorry for the confusion.

Let's say an html file has a tag And in A.js, it invokes a function defined in B.js. In this function, another function in C.js is called and thus C.js will be downloaded (suppose C.js hasn't been downloaded and loaded yet). I just want to know if it is possible to find this "call trace" of A.js-->B.js-->C.js, and also the "downloading sequence" of A.js, B.js and C.js if initially none of them was downloaded.

Yes, it is possible to investigate this by going through the code manually, but i'm trying to understand the relationships of .js files of a fairly large website, which may contain too many js files to be handled manually.

Thanks. I hope this may clarify the question.

macmac
Thanks Olivvv, it looks good, but I was looking for a solution on Mac.I don't know why I can't comment on Olivvv's post. Seems I need some reputation to vote or answer questions?
macmac
A: 

use dynatrace : http://ajax.dynatrace.com/pages/download/download.aspx

Olivvv