Home  >  Article  >  Web Front-end  >  动态添加的HTML的自动渲染_html/css_WEB-ITnose

动态添加的HTML的自动渲染_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:41:371202browse

这两天在写一个用EasyUI的前台,遇到动态向Layout添加HTML内容时没有自动渲染的问题,查了一下网上的资料后得以解决,具体如下:

$("#content").html(data);$.parser.parse("#content");

其中,#content 是 layout 的 Id ,data 是向#content容器中添加的HTML代码。

第一行代码作用是将 Id 是#content的DOM元素的HTML设置为data的值。

第二行代码作用是渲染 Id 是#content的DOM元素及其子元素。

版权声明:本文为博主原创文章,未经博主允许不得转载。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn