简体   繁体   English

如何在Firebug或任何其他插件中查看跨域Javascript请求?

[英]How to view cross domain Javascript requests in Firebug or any other plugin?

How do I view cross-domain JS requests being made in a web page? 如何查看网页中发出的跨域JS请求? Either thru Firebug or any other plugin? 通过Firebug还是其他任何插件?

For instance, suppose I visit stackoverflow.com, and they included a third party JS file (for instance, Google Analytics) How do I view the requests that are being made as the page is loading? 例如,假设我访问stackoverflow.com,并且其中包含第三方JS文件(例如Google Analytics(分析)),如何查看页面加载时正在发出的请求? the URLS being called, the parameters sent, the response, etc. URL的调用,发送的参数,响应等。

I can do this of course for AJAX requests made in the same domain rather trivially. 我当然可以轻松地在同一域中对AJAX请求执行此操作。

Either using the network tab in both 两者都使用网络标签

OR 要么

  • In chrome's console tab right click and select "Log XMLHttpRequest". 在chrome的控制台标签中,右键单击并选择“日志XMLHttpRequest”。
  • In firefox's inspector "Log request and response bodies". 在firefox的检查器中“日志请求和响应正文”。
  • In firefox firebug there is a little down arrow next to "console" in the tab, click that and ensure "Show XMLHttpRequests" is checked. 在firefox firebug中,标签中的“控制台”旁边有一个向下的小箭头,单击并确保已选中“显示XMLHttpRequests”。

If there not showing up, they may be being loaded through JSONP calls and therefore are not actual XMLHttpRequests. 如果未显示,则可能是通过JSONP调用加载了它们,因此不是实际的XMLHttpRequests。 If that is the case, your best option is using the Network tabs. 在这种情况下,最好的选择是使用“网络”选项卡。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM