Tracking ajax requests of embedded javascript files

↘锁芯ラ 提交于 2019-12-08 12:45:18

问题


My question comes from a practical observation: both Twitter and Google provide their sharing buttons, which include share counts on the services. Both buttons are generated with javascript, which means that an API call must be made to obtain a newest share count on the fly. And, not surprisingly, people find solutions:

Google+ count - http://www.tomanthony.co.uk/blog/google_plus_one_button_seo_count_api/

Tweet count - How to get 'ONLY the tweet count' from the twitter button

I imagine the API calls can be traced with Firebug or other similar tools, but after fiddling around I could not find how. If anybody could explain how such debugging can be done, I'd appreciate.


回答1:


In Chrome, there's a Network tab in Developer Tools. There you can see all requests from the current page. For Google+ count, try to find requests made to Google's domains, and check what data has been sent. If there's something like "plusone" in the request payload, then most probably it's the request by +1 script.

Here is an example from this page:

I'm sure you can do this with Firebug, too.




回答2:


It sounds like you haven't discoverer the Firebug Net Panel yet?   (I apologize if you had, but it does meet the question's current stated requirements.)



来源:https://stackoverflow.com/questions/6615677/tracking-ajax-requests-of-embedded-javascript-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!