FireBug和监控JSONP跨域请求 [英] FireBug and monitoring JSONP cross-domain requests
问题描述
这个问题是针对Firefox的Firebug插件的。
This question is specific to the Firebug plugin for Firefox. The actual functionality works, but I lost my ability to monitor and debug it in Firebug.
我有一个使用 JSON $ c>的网站,但是我失去了在Firebug中监视和调试它的能力。 $ c>获取数据。在Firebug中,我能够监视
JSON
请求。它会显示它们中的每一个,标题和返回的数据。
I had a website which used JSON
to get data. In Firebug, I was able to monitor the JSON
requests. It would show me each one of them, the headers, and the data that was returned.
我需要更改我提交的 JSON
请求。为了得到跨域 JSON
工作,我使用 JSONP
与callback =?方法。我得到了工作的功能。但是,我现在无法在Firebug中监视和调试我的 JSONP
请求。
I needed to change the server to which I submitted my JSON
requests. In order to get cross-domain JSON
to work, I used JSONP
with the callback=? method. I got the functionality to work. However, I cannot monitor and debug my JSONP
requests now in Firebug.
3.0.11和我使用jQuery与& callback =? param for my JSONP
请求。
For the record, this in in Firefox 3.0.11 and I am using jQuery with the &callback=? param for my JSONP
requests.
如何获取 JSONP
请求出现在Firebug?
How do I get the JSONP
requests to show up in Firebug?
推荐答案
我不完全熟悉jquery的回调实现,一个脚本标签在页面中进行请求。大多数图书馆。
I'm not totally familiar with jquery's callback implementation but I assume it's injecting a script tag in the page to make the request. Most of the libraries do.
因此,请求应显示在firebug的NET选项卡上,因为它不是一个XmlHttpRequest,而是一个'plain'旧脚本标记,加载了一个src。
Thus, the requests should show up on the NET tab in firebug since it's not an XmlHttpRequest but a 'plain' old script tag with a src getting loaded.
这篇关于FireBug和监控JSONP跨域请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!