在JavaScript 1.6+浏览器(Firefox 1.5+IE9+Opera 7+WebKit 533+)中剥离CSS
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在JavaScript 1.6+浏览器(Firefox 1.5+IE9+Opera 7+WebKit 533+)中剥离CSS相关的知识,希望对你有一定的参考价值。
Array.prototype.slice.call(document.all || document.getElementsByTagName('*')).forEach(function (el) { if (/style/i.test(el.nodeName) || (/link/i.test(el.nodeName) && 'stylesheet' === el.getAttribute('rel'))) { el.parentNode.removeChild(el); } else if (null !== el.getAttribute('style')) { el.removeAttribute('style'); } });
以上是关于在JavaScript 1.6+浏览器(Firefox 1.5+IE9+Opera 7+WebKit 533+)中剥离CSS的主要内容,如果未能解决你的问题,请参考以下文章