Chrome浏览器:检查元素与查看源代码 [英] Chrome: Inspect Element vs View Source

查看:1490
本文介绍了Chrome浏览器:检查元素与查看源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Chrome 10接收XML中的网络服务响应。请求成功完成。然后我想查看结果的内容。



我去检查元素并查看所需的XML。为了好奇,我也查看源代码。我很确定Chrome的工作方式是Inspect Element是正确的结果。



我的问题是Inspect Element和View Source中的结果是不同的。事实上,Inspect Element提供了正确的结果,而View Source提供了一个错误。错误是一个验证错误,所以响应仍然完成,但行为像一个失败。



为什么他们如此不同?



Inspect元素显示当前DOM的快照数据。这是您从初始认证请求获得的结果。所以是的,这是正确的。


I am using Chrome 10 to receive a web service response in XML. The request completes successfully. I then want to view the content of the results.

I go to Inspect Element and see the desired XML. For curiosity, I also view source. I am pretty sure the way Chrome works is that Inspect Element is the correct results.

My issue is that the results in Inspect Element and View Source are different. In fact, Inspect Element gives the correct results while View Source provides an error. The error is an authentication error, so the response is still completing but acting like a failure.

Why are they so different?

解决方案

View Source in Chrome sends another request for the file, and since it's not authenticated, it returns the source of the login page. This is different from the way say IE works, where the source is cached and returned when you try to view it.

Inspect Element shows the current DOM's snapshot data. This is what you got from making your initial, authenticated request. So yes, this is the "correct" one.

这篇关于Chrome浏览器:检查元素与查看源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆