通过“查看源代码”显示的HTML与(Firebug)开发人员工具中显示的HTML不同? [英] Is the HTML shown via 'View Source' different from the HTML shown in (Firebug) developer tools?

查看:132
本文介绍了通过“查看源代码”显示的HTML与(Firebug)开发人员工具中显示的HTML不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



查看源代码中显示的HTML( Ctrl + U )与我在使用Firebug检查元素时看到的HTML不同?



两者之间有什么不同?

解决方案

是的,他们不同。



查看源代码显示页面的原始HTML源代码。

检查器向您显示浏览器解释的DOM。这包括例如JavaScript所做的更改,这些更改在HTML源代码中无法看到。



噢,这也是开发人员工具的功能,它允许您在其他浏览器中查看DOM浏览器,如Chrome Web Inspector和Internet Explorer Developer Toolbar。 HTML源代码在所有浏览器中始终保持不变,生成的DOM可能会有所不同,因为它是一种解释,并且渲染引擎也不尽相同(不幸的是)。(不幸的是)。

I'm using Firefox alongside Firebug Developer tools.

Is the HTML shown in View Source (Ctrl + U) different from the HTML I see when inspecting elements using Firebug?

What are the differences between the two?

解决方案

Yes they are different.

View source shows you the original HTML source of the page.

The inspector shows you the DOM as it was interpreted by the browser. This includes for example changes made by javascript which cannot be seen in the HTML source.

Oh and this also counts for the developer tools that allow you to view the DOM in other browsers, like the Chrome Web Inspector and Internet Explorer Developer Toolbar. The HTML source will always be the same across all browsers, the generated DOM might differ as it is an interpretation and render engines are not all the same (unfortunately).

这篇关于通过“查看源代码”显示的HTML与(Firebug)开发人员工具中显示的HTML不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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