开发者

How can I destroy a refreshed DIV that is previously loaded by a plugin in jQuery?

Explanation:

I have this in the server side:

$objec->write( "divx" );

Then in the user agent (jQuery):

<div id="divx">
<!-- SERVER: here will be the content begins -->
<script type="text/javascript" language="javascript">
var r = $('#divx').myPluginCreator();
</script>
<!-- SERVER: content ends -->
</div>

Now the plugin has a method that communicates with the server (AJAX), and get the same object in the same DIV (divx):

<script> r.refreshObject( 'parameter=morecontentplease' ); </script>

When the new content of the div comes from the server, is assigned by this method using .html() jQuery method, and cleans all in the 'divx' DIV.

My question is if the memory now has 2 objects (the last and the new), or the last element was deleted, if no开发者_StackOverflow中文版t, how to delete it?


No, the previous content of the div is completely removed from the DOM and does not remain in memory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜