从页面中删除未使用的 css 和 javascript

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19804537/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 16:51:37  来源:igfitidea点击:

Remove unused css and javascript from a page

javascriptjquerycss

提问by user1049057

We have a web application which is written in jsp, struts, with lots of css, javascript, jquery. Its a very old application so there are lots of js and css which is written. Since its a very old application there are lots of code written. Now we are in the process of cleaning up the application. Is there is any tool to identify unused js or css?

我们有一个用 jsp、struts 编写的 web 应用程序,有很多 css、javascript、jquery。它是一个非常古老的应用程序,因此编写了大量 js 和 css。由于它是一个非常古老的应用程序,因此编写了大量代码。现在我们正在清理应用程序。是否有任何工具可以识别未使用的 js 或 css?

Thanks

谢谢

回答by Sankar

Use this below site to detect the unused css

使用以下站点来检测未使用的 css

http://unused-css.com/

http://unused-css.com/

Firefox addon- its shows inside a firebug

Firefox 插件 - 它在萤火虫中显示

https://addons.mozilla.org/en-US/firefox/addon/10704/

https://addons.mozilla.org/en-US/firefox/addon/10704/