如何修复Javascript意外令牌非法 [英] how to fix Javascript unexpected token illegal

查看:53
本文介绍了如何修复Javascript意外令牌非法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在第一行的以下代码中收到错误:

I am getting an error in the following code on the first line:

if (typeof module != ‘undefined’ && module.exports) {
  module.exports = PushNotification;
}

这是错误:

我在这里似乎找不到语法错误.我正在尝试将 PushPlugin 用于 iOS.

I cannot seem to find the syntax error here. I am trying to use PushPlugin for iOS.

推荐答案

看起来您是从富文本文档中复制粘贴出来的,并且插入了智能引号:

It looks like you copy-pasted out of a rich text document and it inserted smart quotes:

‘undefined’

用普通引号替换它们:

'undefined'

这篇关于如何修复Javascript意外令牌非法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆