Spying on Ajax
XHRs can be watched (or spied on) with a built-in XHR event listener in FireBug. This tool provides us with the Post or Get tab, the Response tab, and the Headers tab from a request’s response. To activate the XHR spy, we must choose the Show XMLHttpRequests option from the Options drop-down in FireBug. Once activated, it will display all XHRs that are made within a web application. By default, it shows the requested URL and the method that was used to make the request. When one is selected it expands, leaving us with three options: Post or Get (based on the type of request), Response, and Headers. By clicking each of the tabs, we can view the data that was used for each. The Post or Get tab shows us the request that was made, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access