Says “Expecting more source characters”

前端 未结 3 717
夕颜
夕颜 2021-01-28 07:49

That code below gives an error \"Expecting more source characters\" you may please any help me on this issue.

Thanks

Cengiz Yücel A web developer form Turkey

相关标签:
3条回答
  • 2021-01-28 08:29

    check unclosed braces or missed semicolon inside your java script snippet. I got this error whenever I missed a closing brace for a function inside the 'script' tag.

    0 讨论(0)
  • 2021-01-28 08:31

    "Expecting more source characters" normally indicates a line that's not terminated and there is one.

    var cssObj = { 'background-color': '#ffffd' }
    

    needs a semicolon.

    0 讨论(0)
  • Another common source that catches C programmers is the opening brace on functions -- (most) javascript programmers put it at the end of the line and (most) C programmers start it on a new line. Doing both is obviously an error:

    MyClass.LastFunctionInFile = function() {
    {
        Foo();
        Bar();
    }
    

    See it?

    0 讨论(0)
提交回复
热议问题