admin管理员组文章数量:1290536
I am studying this page: / 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?
I am studying this page: http://www.fxstreet./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?
Share Improve this question edited Nov 11, 2011 at 1:20 Wayne Koorts 11.1k13 gold badges48 silver badges72 bronze badges asked Nov 11, 2011 at 1:10 EndangeringSpeciesEndangeringSpecies 1,5941 gold badge17 silver badges39 bronze badges 1- In Chrome, you can view the XMLHttpRequests by selecting that option in the right click menu of the console window. – Blender Commented Nov 11, 2011 at 1:12
3 Answers
Reset to default 9In 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.
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
In firebug, or chrome dev tools, select the js file etd-1.1.2-teletrader.js. Once there, you can set a breakpoint at line 167 or :
function _longpollComplete
you can also put a breakpoint at line 171 :
function _plete
once you break into the code you can see the objects being returned which contain the data which update the grid. you can step into _longpoolComplete and see the data structure :
0: Object channel: "/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
etc.
本文标签:
版权声明:本文标题:How do I findprofile what JavaScript is being executed "right now" using Firebug or any other way? - Stack Ove 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741499824a2382005.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论