简体   繁体   中英

Show HTML from JS in the source code

是否可以在页面源ctrl + U )上显示我在JavaScript和jQuery代码中添加的HTML元素?

No.

The page source will always show you the HTML retrieved from the server.

Inspect the generated DOM tree instead, eg with Firebug (Firefox) or the Developer Tools (Chrome, Safari).

不,您可以在萤火虫,开发人员工具等上看到它。

不,但是现代的浏览器都有一种方法/扩展来查看当前的源代码(实际上是DOM树),即包括由JavaScript完成的所有操作。

Depending on the browser (i like chrome / firefox / safari for this) you want to look at developer tools. In firefox you can use firebug, in chrome it's Developer Tools and in Safari you have to turn on Developer menu through preferences. In all three cases, you want to look at the DOM inspector.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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