将文本从javascript注入到html“查看源代码"中; [英] inject text from javascript to html "View source"

查看:136
本文介绍了将文本从javascript注入到html“查看源代码"中;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用JavaScript更改文本时,文本不会出现在HTML查看源代码"中.是否可以将信息注入HTML查看源代码". (当我编写查看源代码"时,我的意思是当您在浏览器中按下鼠标右键时,您可以查看从服务器返回的源代码)

When I change text using JavaScript The text does not appear in the HTML "View source". Is it possible to inject information to the HTML "View source". (When I write View source I mean to While you pressing on the right mouse button in the browser you can view the source code That returns from the server)

推荐答案

查看源"仅向您显示从服务器的响应中接收到的HTML.您的JS更改随后发生.

View Source shows you only the HTML it received from the server's response. Your JS changes happen afterward.

Firebug和Chrome的调试器会动态地向您显示源,因此您可以查看已更改的DOM和HTML.但是查看源只会向您显示浏览器从服务器接收到的内容.

Firebug and Chrome's debugger show you the source dynamically so you can see the DOM and HTML as it has been changed. But view source will only ever show you what the browser received from the server.

这篇关于将文本从javascript注入到html“查看源代码"中;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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