跟踪嵌入JavaScript文件Ajax请求文件、JavaScript、Ajax

2023-09-10 19:00:40 作者:彼岸花似海

我的问题来自于实际的观察:Twitter和谷歌提供的共享按钮,其中包括对服务的份额数。使用JavaScript生成两个按钮,这意味着API调用必须进行,以获得在飞行一个最新的股数。而且,这并不奇怪,人们找到解决办法:

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+计数 - http://www.tomanthony.co.uk/blog/google_plus_one_button_seo_count_api/

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

分享Tweet计数 - How从Twitter的按钮得到只推计

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

我想象中的API调用可与萤火虫或其他类似的工具来跟踪,但摆弄周围后,我怎么也找不到。如果有人可以解释调试怎么这么能做到,我倒是AP preciate。

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.

推荐答案

在Chrome浏览器,有一个在开发工具网络选项卡。在那里,你可以看到当前页面的所有请求。对于Google+的统计,试图找到谷歌的领域提出的要求,检查一下是什么数据已被发送。如果有类似的请求负载plusone,那么很可能是由+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.

下面是从此页面一个例子:

我相信你可以做到这一点与萤火虫了。

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