[英]JavaScript - Uncaught SyntaxError: Unexpected token )
Hi whats wrong in this code, where is the syntax error.. i got that error: 嗨,这段代码有什么问题,语法错误在哪里。
NOTE: The first block of code is where chrome detect error on autosizeProgress. 注意:第一个代码块是chrome在autosizeProgress上检测错误的位置。
But even if i delete this block the error is still there: 但是,即使我删除了此块,错误仍然存在:
EDIT 2: 编辑2:
I found the error!! 我发现了错误!
<script>
// JavaScript object for later use
var player = new MediaElementPlayer('#player',/* Options */); <--
// ...
</script>
By the way just like a note. 顺便说一句。 the code is working.. i can see the video, but i dont want an error on console.
该代码正在工作..我可以看到视频,但我不希望在控制台上出错。 thanks
谢谢
<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>
I also rewrite it to see if there where no illegal chars overthere, =( i cant found the problem 我也将其重写以查看是否没有非法字符覆盖,=(我找不到问题
In older version of IE
the extra comma in the object literal will throw syntax errors: 在旧版的
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 ;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.