Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find/profile what JavaScript is being executed "right now" using Firebug or any other way?

I am studying this page: http://www.fxstreet.com/rates-charts/currency-rates/ which is continually updated by JavaScript with new data from the server. So clearly there is some JavaScript function continually executing in the page. So I opened Firebug and I don't see any "profiler" type output that would continually add new info about executing scripts. The "script" tab only shows 46 not very clear records, without timestamps and without any indication that there is continual new JavaScript activity to profile.

What am I doing wrong? How do I go about groking the JavaScript activity on a page?

like image 329
EndangeringSpecies Avatar asked Nov 11 '11 01:11

EndangeringSpecies


2 Answers

In the Console tab of Firebug there is a Profile button next to Clear and Persist, which does what you're trying to do. It's not real-time but you can let it run for a certain time period and analyse the results afterwards which should show you what you're looking for.

like image 85
Wayne Koorts Avatar answered Sep 18 '22 10:09

Wayne Koorts


You can do one of three things

  • Put in console.log() lines to output to the console what data you want to see as your application is running
  • add "watches" to objects in your application which will automatically update when that object changes in your application
  • Put breakpoints in your code and manually debug through your code step by step to see how it is running

If it is server request/response information you are looking for you want to look at the "Net" tab of firebug

like image 34
Keith.Abramo Avatar answered Sep 21 '22 10:09

Keith.Abramo