Tag Archives: innerHTML

通过 Dom 方法提高 innerHTML 性能,性能不升反降?

function replaceHtml(el, html) {
var oldEl = typeof el === “string” ? document.getElementById(el) : el;
/*@cc_on // 原始的 innerHTML 在 IE 中的性能好一点
oldEl.innerHTML = html;
return oldEl;
[...]