admin管理员组

文章数量:1336632

When observing the Network tab of Chrome's Developer Tools on a profile page on Facebook, I noticed that almost no XHR requests have been captured. Clicking around the profile page, like clicking on a link to view the profile's photos shows that no AJAX requests have been made, but the site seems to remain on the same page like a single-page-application and behave very AJAX-like.

Does Facebook profile pages really use AJAX requests like jQuery's $.get()? If so, why dont they appear in Developer Tools. If not, how can I achieve the same effect?

When observing the Network tab of Chrome's Developer Tools on a profile page on Facebook, I noticed that almost no XHR requests have been captured. Clicking around the profile page, like clicking on a link to view the profile's photos shows that no AJAX requests have been made, but the site seems to remain on the same page like a single-page-application and behave very AJAX-like.

Does Facebook profile pages really use AJAX requests like jQuery's $.get()? If so, why dont they appear in Developer Tools. If not, how can I achieve the same effect?

Share Improve this question asked Jul 31, 2012 at 0:31 NyxynyxNyxynyx 63.7k163 gold badges507 silver badges856 bronze badges 2
  • 1 They probably use JSONP – Greg Guida Commented Jul 31, 2012 at 0:33
  • In Chrome I'm observing all sorts of traffic both active (I'm doing something, clicking a button) and passive (periodic requests for new information). Try turning on console logging of of XMLHttpRequests (Bottom Right corner of the Developer Tools window, then under Console). Then observe the Network tab and the console and see if that makes a difference. – Brandon J. Boone Commented Jul 31, 2012 at 2:14
Add a ment  | 

2 Answers 2

Reset to default 5

I have gotten bitten by this myself in the past. When viewing the Network tab, you can filter out what kind of requests you want the developer's tools to show. By default "all" is selected. However, if you accidentally click on "JS", "CSS", etc, then only those requests will be displayed.

Click "All" and your problem will be resolved.

  • Offcourse you can capture JSONP-requests. JSON-P is nothing more than ordinary JSON-data, but wrapped in a JavaScript function. Responses will look like:

    jQuery17206302290489639558_1343824008197([{"

  • That it might not show up in Chrome developer tools may be caused by usage of HTTPS.

By the way, if you are interested or perhaps currently exploring how to interact with Facebook API, there are plenty of (free) and online tools out there. Apigee's Facebook Console is a really good one: https://apigee./console/facebook

本文标签: javascriptAJAX requests not captured by Chrome Developer ToolsStack Overflow