How to find / work out what JavaScript is executing "right now" using Firebug or any other way?

I am studying this page: http://www.fxstreet.com/rates-charts/currency-rates/ , which is constantly updating JavaScript with new data from the server. Thus, there is a specific JavaScript function that is constantly running on the page. Thus, I opened Firebug, and I do not see a "profiler" type output that would constantly add new information about script execution. On the "script" tab, only 46 not very clear records are displayed without time stamps and without any indication that new JavaScript activity is constantly included in the profile.

What am I doing wrong? How can I characterize JavaScript activity on a page?

+6
source share
3 answers

On the Console tab in Firebug, there is a Profile button next to Clear and Persist , which does what you are trying to do. This is not real-time, but you can let it work for a certain period of time and analyze the results afterwards, which should show you what you are looking for.

+9
source

You can do one of three things.

  • Insert the lines console.log () to display on the console what data you want to see when the application starts.
  • add a "clock" to the objects of your application, which will be automatically updated when this object is changed in your application.
  • Put breakpoints in your code and manually debug your code step by step to see how it works.

If you are looking for server request / response information, you want to see the "Net" tab in firebug

+1
source

In the firebug or chrome dev tools, select the js file cometd-1.1.2-teletrader.js. After that, you can set a breakpoint on line 167 or:

 function _longpollComplete 

you can also set a breakpoint on line 171:

 function _complete 

as soon as you enter the code, you can see returned objects containing data that update the grid. you can go to _longpoolComplete and see the data structure:

0: Channel object: "/ teletrader / symbols / 3212198" data: object change: "0.0124" changePercent: "0.1848" dateTime: "11.11.2011 02:19:20" last: "6.6964" symbolId: 3212198

1: Object channel: "/ teletrader / symbols / 3212160" data: object change: "-0.2725" changePercent: "-0.2202" dateTime: "11.11.2011 02:19:21" last: "123.4650" symbolId: 3212160

and etc.

0
source

Source: https://habr.com/ru/post/901263/


All Articles