English 中文(简体)
J Query 活度
原标题:JQuery get live DOM change HTML

例如,Say公司在Jquery的一个变量中储存了体标的的超文本内容。 因此,

var current_html = $("body").html();

然后,我对一些要人进行了思考,并进行其他动态变化。 即使我以某种原因更新了每个电离层变动后的变现_html,它只是从来才产出文件负荷上的原电离层扰动内容,并且没有包含任何附后的项目。

So is there a way to read the current DOM html including all items that have been appended dynamically. I ve tried various uses of .live but no joy.

提前感谢。

问题回答
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="jquery-1.4.2.min.js"> </script>
</head>

<body>
<script type="text/javascript">
$(document).ready(function(){
console.log($("body").html());
var new_element = $( <div id="2-div">test2 </div> );
new_element.appendTo("body");
console.log($("body").html());
});

 </script>

<div id="1-div">test-1</div>
</body>
 </html>

我就此进行了审判,并进行了罚款。 在新内容附后后,我得以看到更新的超文本。 如果上述事情不是你所指的,你可以提出某些法典。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签