Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view all JavaScript functions called in real time?

Tags:

javascript

I want to figure out how a website reloads it's content using AJAX. Therefore i would like to see what JS functions are called in real time because I can't figure out what function is responsible for reloading the page dynamically. How to see all executed functions JS in real time in FF, Chrome, Opera or IE?

like image 978
Tom Smykowski Avatar asked Aug 13 '11 09:08

Tom Smykowski


People also ask

How do you see all properties of JavaScript function in console?

dir() The method console. dir() displays an interactive list of the properties of the specified JavaScript object.

How do you display a function in JavaScript?

You can display output in JavaScript using any of the following ways: To display output in the browser console, you can use the “console. log()” function. To write out into HTML and display its output, you can use the “document.

Where are JavaScript functions stored?

They are objects and they are stored in memory by reference.


3 Answers

Maybe using the 'profile' button in the firebug console tab can give you an indication of the function(s) that are fired. Furthermore you can tell firebug's console to show xmlhttp requests (expand 'console' at the top of the firebug screen. After that, If an ajax request fires, it should be visible in the console. In the 'post' tab in such a request you may be able to infer the function triggering the request, looking at the parameters.

like image 110
KooiInc Avatar answered Nov 20 '22 07:11

KooiInc


I think what you want is a feature in Chrome:

find the element that is being reloaded and right click, choose inspect from context menu, then right click the html of the element (in the bottom firebugish pane), in the context menu there are options to:

  • break on subtree modifications
  • break on attributes modifications
  • break on node removal

in your case maybe set "break on subtree modifications" on the body tag would do it?

Article on awesome new dev features in chrome: http://www.elijahmanor.com/2011/08/7-chrome-tips-developers-designers-may.html

like image 20
Matthew Avatar answered Nov 20 '22 06:11

Matthew


Install firebug in FF. Visit this link: http://getfirebug.com/

like image 1
yasar Avatar answered Nov 20 '22 07:11

yasar