页面源没有动态div元素 [英] page source doesn't have dynamic div element

查看:56
本文介绍了页面源没有动态div元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jQuery中动态添加"div"的内容,并将其添加到DOM中.但在查看页面源代码中,我看不到元素的动态内容

I am dynamically adding the content of "div" in jquery it is added in DOM. but in view page source i can't see dynamic content of an element

<div id="pdf"></div>

("#btn").click(function(){
$("#pdf").html("ffff");
});

进行动态更改后如何获取更新的页面源.它是在DOM中添加的,但是页面源没​​有内容?为什么?

how can i get updated page source after made dynamic changes. it is added in DOM but page source doesn't have the content ? why ?

谢谢

Siva

推荐答案

这只是正常现象,来源始终是页面的原始来源,并且不显示页面加载后所做的更改.如果您想在更改后检查源代码,请使用Firebug或chrome开发人员工具之类的工具.

that's just normal behavior, the source is allways the original source of the page and it doesn't show changes made after page load. If you want to check the source after changes use a tool like firebug or chrome developer tools.

正如Johannes H所说,您不再需要Firebug,因为主要的浏览器都包含开发人员工具.

As Johannes H stated you no longer require firebug since major browsers all include developer tools.

这篇关于页面源没有动态div元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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