Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 emacs (js2-mode) 对 javaScript 进行编码。这是一个简单的代码片段,其中 emacs 总是向我显示语法错误:
<script> var x = function (a, b) { return a * b; }; </script>
“{”和“return a”总是用红色着色,有人能告诉我为什么吗?到目前为止,有人使用过 js2-mode 吗?
我认为问题出在代码中的脚本标签上,因为 JavaScript 文件中不应该有任何 HTML,因此会出现语法错误。