Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
编译器错误您正在使用已禁用的JavaScript_Javascript_Css_Less - Fatal编程技术网

编译器错误您正在使用已禁用的JavaScript

编译器错误您正在使用已禁用的JavaScript,javascript,css,less,Javascript,Css,Less,当我试图使用crunch编译更少的代码时,我得到了以下错误消息。 错误是: 编译器错误 您正在使用已禁用的JavaScript。电话号码:25 文件名:\assets\css\less\custom-mixins.less // Backgrounds mixin // ------------------------- .panel-bg(@bg) { background: @bg; background-color: @bg; } // Custom mixins for

当我试图使用crunch编译更少的代码时,我得到了以下错误消息。 错误是: 编译器错误 您正在使用已禁用的JavaScript。电话号码:25 文件名:\assets\css\less\custom-mixins.less

// Backgrounds mixin
// -------------------------
.panel-bg(@bg) {
    background: @bg;
    background-color: @bg;
}

// Custom mixins for hardware acceleration for webkit
// --------------------------------------------------
.webkitForceHardwareAcceleration() {
-webkit-transform: translate3d(0, 0, 0);
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
}

// Retina ready mixins for images
// --------------------------------------------------
// A helper mixin for applying high-resolution background images (http://www.retinajs.com)
// Usage  .at2x('/images/my_image.png', 200px, 100px);

@highdpi: ~"(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";

.at2x(@path, @w: auto, @h: auto) {
  background-image: url(@path);
  @at2x_path: ~`@{path}.replace(/\.\w+$/, function(match) { return "@2x" + match; })`;

  @media @highdpi {
    background-image: url("@{at2x_path}");
    background-size: @w @h;
  }
}
第25行是

 @at2x_path: ~`@{path}.replace(/\.\w+$/, function(match) { return "@2x" + match; })`;

如何解决这个问题?Javascript已启用

最好将内联javascript语句替换为内置函数,不管Crunch选项如何,都建议使用内置函数。javascript已启用。可能应该编辑您的OP以提及JS已启用。似乎是与错误消息相关的关键细节。