发现在Web项目中未使用的CSS规则和JS脚本? [英] Find unused CSS rule and js script in a web project?

查看:150
本文介绍了发现在Web项目中未使用的CSS规则和JS脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI ..
我的项目有很多CSS的角色和未在我的项目中使用的JavaScript脚本。我怎样才能找到这些未使用的文件?

HI.. My project has many CSS roles and JavaScript scripts that are not used in my project. How can I find these unused files?

推荐答案

有一个名为的尘我选择器,该扫描页面,这是不被使用的CSS。

There is a nice little firefox plugin called Dust Me Selectors, which scans a page for CSS which isn't being used.

这是在你的样式表是多余的东西察觉一个很好的工具。

It's a very good tool for spotting things in your stylesheets which are redundant.

不过,你仍然需要小心使用它,因为它是完全可能的,因为当你运行程序样式表是未使用的,但仍然有必要为您的网站 - 即它可用于动态内容,或用于其他共享相同的样式表code,网页等。

However, you still need to be careful with it, as it is quite possible for a stylesheet to be unused when you run the program, but still necessary for your site - ie it could be used for dynamic content, or for other pages which share the same stylesheet code, etc.

我已经打消了我的previous编辑,我注意到,这一项目可能已被抛弃,因为事实上,它看起来像它的背部在积极发展。好消息全方位的。

I've removed my previous edit where I noted that this project might have been abandoned, because in fact it looks like it's back in active development. Good news all round.

这篇关于发现在Web项目中未使用的CSS规则和JS脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆