html/js/css_html / js / css大小的快速统计

news/2024/7/19 14:16:46 标签: java, js, javascript, php, python
html/<a class=js/css" width="403px" height="256px" style="outline: none;" />

html/js/css

I'm sure better tools exist, but hey, quick and dirty is faster:

我敢肯定,存在更好的工具,但是嘿,快速又肮脏会更快:

const total = document.documentElement.innerHTML.length;
const scripts = Array.from(document.getElementsByTagName('script')).reduce((total, e) => total += e.innerHTML.length, 0);
const styles = Array.from(document.getElementsByTagName('style')).reduce((total, e) => total += e.innerHTML.length, 0);
console.log("scripts", scripts, "styles:", styles, "html:", total - scripts - styles);

Running it quickly tells me where the wins can come from:

快速运行它可以告诉我获胜的来源:

qss

Tell your friends about this post on Facebook and Twitter

在Facebook和Twitter上告诉您的朋友有关此帖子的信息

翻译自: https://www.phpied.com/quick-stats-on-html-js-css-sizes/

html/js/css


http://www.niftyadmin.cn/n/1306199.html

相关文章

Java Web项目结构

Java Web项目结构&#xff08;一般&#xff09; 1、Java src 2、JRE System Library 3、Java EE 6 Libraries 4、Web App Libraries 5、WebRoot

非ui线程更新ui_UI线程外CSS动画

非ui线程更新uiThis excellent Google I/O talk mentions that Chrome for Android moves the CSS animations off of the UI thread, which is, of course, a great idea. Playing around with it, heres what I found: 谷歌在I / O上的精彩演讲提到&#xff0c;Chrome for An…

Java Web项目中缺少Java EE 6 Libraries怎么添加

Java Web项目中缺少Java EE 6 Libraries怎么添加 具体步骤如下&#xff1a; 1、项目名称上点击鼠标右键&#xff0c;选择“Build Path-->Configure Build Path-->Java Build Path” 2、单击“Add Library...” 3、选择“User Library”&#xff0c;单击“Next” 4、单击…

恶梦护士 asa_WebMIDI的噩梦场景

恶梦护士 asaIn the spirit of Halloween... allow me to entertain you with some security and privacy nightmares with the way WebMIDI is implemented in Chrome currently. 本着万圣节的精神&#xff0c;...让我利用目前在Chrome中实现WebMIDI的方式为您带来一些安全和隐…

Flex中配置FusionCharts

Flex中配置FusionCharts 1、配置前说明 &#xff08;需要的工具和插件&#xff09; 1.1 MyEclipse10.01.2 Flash Builder4.01.3 FusionCharts.swc&#xff08;Flex4.0&#xff09;1.4 FusionCharts_fcBack.as1.5 FusionCharts.as1.6 fusioncharts swf文件1.7 fusionwidgets swf…

在Mac上为PHP安装v8js

动机&#xff1f;(Motivation?) Run JS code inside PHP. Just... because &#x1f642; 在PHP中运行JS代码。 只是...因为&#x1f642; I struggled for a while with this installation, so leaving a trail here for anyone looking. 我为此安装苦苦挣扎了一段时间&#…

安装STS报错(一)

安装STS报错 1、具体报错如下 2、报错原因 3、解决办法

安装STS报错(二)

安装STS报错 1、启动时报错 2、报错原因 3、处理办法