原生JS添加DOM
2021-03-07 18:26
标签:内存回收 www img function before 世界 fragment UNC type prependHTML: 原生JS添加DOM 标签:内存回收 www img function before 世界 fragment UNC type 原文地址:https://www.cnblogs.com/llcdbk/p/12884092.htmlHTMLElement.prototype.appendHTML = function(html) {
var divTemp = document.createElement("div"), nodes = null
// 文档片段,一次性append,提高性能
, fragment = document.createDocumentFragment();
divTemp.innerHTML = html;
nodes = divTemp.childNodes;
for (var i=0, length=nodes.length; i
var prependHTML = function(el, html) {
var divTemp = document.createElement("div"), nodes = null
, fragment = document.createDocumentFragment();
divTemp.innerHTML = html;
nodes = divTemp.childNodes;
for (var i=0, length=nodes.length; i
转载:https://www.cnblogs.com/7qin/p/12117251.html
上一篇:http与https协议整理
下一篇:前端入门03——CSS