• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

JavaScript logger?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    JavaScript logger?

    Does anyone happen to know of a browser plug-in of some kind which will allow me to view all JavaScript function calls which are made on a web page?

    I want to be able to, say, click on a button on the page and get a console display of what function is called by that event, and any further functions that are called by that function.

    I thought Firebug could do something like that, but I can't figure out how, if it does.

    #2
    Originally posted by dang65 View Post
    Does anyone happen to know of a browser plug-in of some kind which will allow me to view all JavaScript function calls which are made on a web page?

    I want to be able to, say, click on a button on the page and get a console display of what function is called by that event, and any further functions that are called by that function.

    I thought Firebug could do something like that, but I can't figure out how, if it does.
    I think Firebug has a Javascript console.
    Cats are evil.

    Comment


      #3
      Originally posted by swamp View Post
      I think Firebug has a Javascript console.
      Yeah, it does, but it doesn't (as far as I can make out) allow you to just log all JavaScript function calls on a page as they happen.

      The closest it comes is that you can put console.trace() into one of your functions and it will log when that function is called and any other functions which are called by that function. Close, but not what I need.

      I've Googled and can't find anything. I'd have thought such a logger would be quite useful for developers, though this is the first time I've really needed it myself.

      Comment


        #4
        It won't preserve sequence, but Firebug includes a JS profiler - that will show you where your code is spending the most time. It allows you to sort functions by number of invocations, percentage of total JS execution time, average run time, max/min run time, and so on.

        To activate it, switch to the Console tab, click the "Profile" button at the top, do whatever you want to profile (click something if you're analysing an onclick handler, reload the page if you want to see what happens when the page loads, etc.) and then, when you're done, click "Profile" again and it will display the results.

        Oh, and be careful how you move the mouse to and from the profile button if you have any onmouseover/onmousemove handlers. If necessary, leave the mouse pointer where it is, use Tab to get to the button, use the mouse to start the profiler, hit the spacebar to click the button, then use the mouse again to stop the profiler.
        Last edited by NickFitz; 14 January 2009, 18:20.

        Comment

        Working...
        X