在debian linux中使用Opera或chome等浏览器时,页面会加载js错误。这不会发生在任何其他浏览器中,事实上我甚至无法重现它,但另一个用户可以在他的系统上的几乎每个浏览器中重现它。
错误是:
[12/07/11 19:08:22] JavaScript - http://demo.phppointofsalestaging.com/js/jquery-1.6.1.min.js
Linked script compilation
Syntax error at line 2 while loading:
,"*":"*/**/*;q=0.01":""):d.accepts["*"])
--------------------^
expected '}', got ':'
[12/07/11 19:08:23] JavaScript - http://demo.phppointofsalestaging.com/index.php
Inline script thread
Uncaught exception: ReferenceError: Undefined variable: $
Error thrown at line 1, column 0 in http://demo.phppointofsalestaging.com/index.php:
$(document).ready(function()
[12/07/11 19:08:33] JavaScript - http://demo.phppointofsalestaging.com/js/jquery-1.6.1.min.js
Linked script compilation
Syntax error at line 2 while loading:
,"*":"*/**/*;q=0.01":""):d.accepts["*"])
--------------------^
这仅在jquery缩小时发生,否则不会发生。这令人难以置信。
答案 0 :(得分:2)
只是单挑......
http://bugs.jquery.com/ticket/10153#comment:2
您的minifier错误地将QUOTED字符串中的/ *视为 多行Javascript评论的开头。请不要 快乐有趣的JQUERY与破碎的minifier;而是使用 code.jquery.com或任何一个版本的适当缩小版本 的CDN。