简体   繁体   English

这里意外的令牌(Meteor)在哪里?

[英]Where is the unexpected token here (Meteor)?

With the following code:使用以下代码:

Template.peopleGrid.events({
  'click #btnTextChecked': function() {
    alert('you clicked the btnTextChecked button');
  },
  'click #textmorph': function(evt) {
    var clicked = evt.target;
    var currentText = clicked.innerHTML;
    alert(currentText);
    if (currentText === 'Not sent') {
      clicked.innerHTML = 'Sent';
      clicked.style.color = 'yellow';
    } else if (currentText === 'Sent') {
      clicked.innerHTML = 'Need Help';
      clicked.style.color = 'red';
    } else if (currentText === 'Need Help') {
      clicked.innerHTML = 'Are OK';
      clicked.style.color = 'green';
    }
  }
});

I'm getting this:我得到这个:

   While processing files with ecmascript (for target web.browser):
   client/ruokclient.js:56: client/ruokclient.js: Unexpected token (56:0)

=> Your application has errors. Waiting for file change.

Yet there is no line 56. The code above goes through line 55, and that's where ruokclient.js ends.但是没有第 56 行。上面的代码通过第 55 行,这就是 ruokclient.js 结束的地方。

So what could be causing this?那么是什么原因造成的呢?

The code I'm using is from the answer given here .我使用的代码来自此处给出的答案。

Unfortunately this is one of those cases where the error message of the interpreter/compiler isn't helpful.不幸的是,这是解释器/编译器的错误消息没有帮助的情况之一。 Reading between the lines, if the code ends at line 55 and it complains about the first character of line 56 then the unexpected token is probably the end of file.在两行之间阅读,如果代码在第 55 行结束并且它抱怨第 56 行的第一个字符,那么意外的标记可能是文件的结尾。

Check if you have any brace unclosed.检查您是否有任何未闭合的支架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM