我已经玩了一段时间了,但无法在 IE 8 上运行 LESS!
我制作了一个非常简单的页面来对其进行测试。
这是 HTML...
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet/less" href="css/v1.less">
<script src="js/jquery.js"></script>
<script src="js/less.js"></script>
</head>
<body>hello world!</body>
</html>
这是 LESS...
@base_colour:red;
body {
background:@base_colour;
}
这适用于 Firefox,但不适用于 IE 8。
jQuery 工作正常,因为我测试了使用 $('body').css()
更改背景,它在 IE 8 中没有问题。
我尝试将 type="text/css"
添加到链接标签并返回到旧学校文档类型,但这没有任何区别。
有什么指点吗?
最佳答案
在 lesscss.org 的 head 部分你可以阅读
LESS runs on both the server-side (with Node.js and Rhino) or client-side (modern browsers only).
我认为 IE8 不是现代浏览器。 ;)
这是一个有趣的信息: http://starikovs.com/2012/11/27/does-less-js-support-ie-9-at-least/
LESS 的作者说:
IE9 is not officially supported – it may or may not work.
关于jquery - 为什么 LESS 不能在 IE8 上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18574212/