0

I am using emacs (js2-mode) for coding javaScript. Here is a simple code snippet where emacs always shows me a syntax error:

<script>
    var x = function (a, b)
    {
        return a * b;
    };
</script>

The "{" and "return a" are always colored in red, can somebody tell me why? Has anyone worked with js2-mode so far?

ntalbs
  • 28,700
  • 8
  • 66
  • 83
ThinkPad
  • 9
  • 1
  • 1
  • 2

1 Answers1

0

I think the problem arises from the script tags you have in the code, as there shouldn't be any HTML in a JavaScript file, hence the syntax errors.

Andrew Winterbotham
  • 1,000
  • 7
  • 13