javascript - AJAX requests not captured by Chrome Developer Tools - Stack Overflow

When observing the Network tab of Chrome's Developer Tools on a profile page on Facebook, I notice

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742413894a4439359.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信