Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
513 views
in Technique[技术] by (71.8m points)

ajax - 在Chrome开发人员工具中查看AJAX响应内容?(View AJAX response content in Chrome developer tools?)

Traditionally I use FireBug to debug my AJAX requests.

(传统上,我使用FireBug调试AJAX请求。)

It lets you examine both the contents of your request as well as the response that was sent back from the server.

(它使您既可以检查请求的内容,也可以检查从服务器发回的响应。)

(it also notifies you in the console when these occur, which is a useful feature that Chrome seems to lack).

((当这些发生时,它还会在控制台中通知您,这是Chrome似乎缺少的有用功能)。)

In Chrome, I only seem to be able to view the requests, not the responses.

(在Chrome中,我似乎只能查看请求,而不能查看响应。)

When I try to examine the response the UI just displays "No Content Available" (Developer Tools > Resources > myRequest.php > Content).

(当我尝试检查响应时,UI只会显示“无可用内容”(开发人员工具>资源> myRequest.php>内容)。)

Do I have to turn something on to make the Chrome developer tools remember these requests?

(我是否必须打开电源才能使Chrome开发人员工具记住这些请求?)

EDIT: In case it matters, these requests are being made inside a Flash object.

(编辑:如果很重要,这些请求是在Flash对象内部进行的。)

  ask by Ender translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you are on a dev channel of Google Chrome:

(如果您使用的是Google Chrome浏览器的开发者频道:)

http://www.chromium.org/getting-involved/dev-channel

(http://www.chromium.org/getting-involved/dev-channel)

...you should be able to right-click in the Developer Tools console, and click "Enable XMLHttpRequest logging".

(...您应该能够在开发人员工具控制台中右键单击,然后单击“启用XMLHttpRequest日志记录”。)

Once it is enabled, you will see the XHR requests in the console, and will be able to click on them to take you to the resources panel, where you'll be able to see the content of an XHR.

(启用后,您将在控制台中看到XHR请求,并且可以单击它们将您带到资源面板,在该面板中您可以看到XHR的内容。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...