是否有一个 jquery 插件来验证 CSS?
我的意思是,我想让用户在文本框中输入自己的 CSS 并使用 jquery 验证是否是有效的 CSS?
例子:
@font-face {
font-family: 'NationalRegular';
src: url('http://localced.com/national-regular-webfont.eot');
src: local('National'), local('NationalRegular'), url('http://localced.com/national-regular-webfont.woff') format('woff'), url('http://localced.com/national-regular-webfont.ttf') format('truetype'), url('http://localced.com/national-regular-webfont.svg#webfontHGfqMJAZ') format('svg');
font-weight: normal;
font-style: normal;
***notgoodCSS***:this is not good;
}
最佳答案
在您自己的服务器上使用 W3C 验证器。
执行命令行并将结果返回给 jquery(通过 Ajax 调用)。
关于javascript - 使用 jquery 格式化和验证 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4433902/