JavaScript - 未捕获的语法错误:意外的令牌)
JavaScript - Uncaught SyntaxError: Unexpected token )
嗨,这段代码出了什么问题,语法错误在哪里。 我得到了那个错误:
注意:第一个代码块是chrome在自动调整进度上检测错误的地方。
但即使我删除了这个块,错误仍然存在:
编辑2:
我发现了错误!!
<script>
// JavaScript object for later use
var player = new MediaElementPlayer('#player',/* Options */); <--
// ...
</script>
顺便说一下,就像一张便条。 代码正在工作.. 我可以看到视频,但我不希望控制台出现错误。 谢谢
<script>
$('audio,video').mediaelementplayer({
// if the <video width> is not specified, this is the default
defaultVideoWidth: 530,
// if the <video height> is not specified, this is the default
defaultVideoHeight: 377,
autosizeProgress: true,
// Hide controls when playing and mouse is not over the video
features: ['playpause','progress','current','duration','tracks','volume','sourcechooser','fullscreen'],
alwaysShowControls: false,
});
</script>
我还重写了它,看看那里是否有非法字符,=(我找不到问题
在旧版本的IE
中,对象文字中多余的逗号将抛出语法错误:
$('audio,video').mediaelementplayer({
defaultVideoWidth: 530,
defaultVideoHeight: 377,
autosizeProgress: true,
features: ['playpause','progress','current','duration','tracks','volume','sourcechooser','fullscreen'],
alwaysShowControls: false //Extra Comma Removed
}); //added ;
相关文章:
- React JS:未捕获(在承诺中)语法错误:在位置 0 的 JSON 中意外<令牌
- jQuery$.getJSON抛出意外令牌
- 为什么我在下面的..of循环中得到意外令牌
- 组件中的ReactJS意外令牌
- AngularJS $http GET 请求到本地 JSON 文件返回语法错误:意外令牌]
- 巴别塔,意外令牌 (15:33) ::.
- Sencha 2.0 和 Codeigniter RESTful API 生成未捕获的语法错误:意外令牌:
- 在事件上使用 jquery 时出现意外令牌
- JSON 中位置 4 处的意外令牌<
- 意外令牌 ) 在我的代码中
- Electron 和 Babel 6 异步/等待抛出意外令牌
- “JSON.parse(str)”返回“意外令牌c”,但str是一个字符串
- jQuery after() uncatch SyntaxError: 意外令牌 ILLEGAL
- 使用节点javascript的意外令牌ILLEGAL
- Javascript/JQuery-Chrome意外令牌
- Ajax 帖子未捕获语法错误:意外令牌非法
- angularjs-SyntaxError:请求从服务器返回时出现意外令牌
- jquery:使用ember的意外令牌C
- React本机项目中的意外令牌
- 解析有效的 JSON 得到“语法错误:意外令牌非法”