这段代码给了我这个错误:missing : after property list
,其中错误注释是.
$("#jquery_jplayer_1-<?php echo $key.'-'.$j; ?>").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
<?php echo $info['extension'];?>: "<?php echo "AudioFiles/".$a; ?>"
});
},
$(this).bind($.jPlayer.event.play, function() { //ERROR HERE
$(this).jPlayer("pauseOthers");
},
solution:"flash,html",
swfPath: "jquery",
supplied: "<?php echo $info['extension'];?>"
});
我想知道如何修复这个错误,我是否通过查看以下文档正确地实现了pauseOthers
功能:DOCUMENT
您正在进行以下调用:
$(this).bind($.jPlayer.event.play, function() { //ERROR HERE
$(this).jPlayer("pauseOthers");
}
在声明对象文字的过程中出错:
{
ready: function () {
$(this).jPlayer("setMedia", {
<?php echo $info['extension'];?>: "<?php echo "AudioFiles/".$a; ?>"
});
},
solution:"flash,html",
swfPath: "jquery",
supplied: "<?php echo $info['extension'];?>"
}
这仅仅是无效的JavaScript语法。也许你想把.bind()
调用放在ready
回调中?
$("#jquery_jplayer_1-<?php echo $key.'-'.$j; ?>").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
<?php echo $info['extension'];?>: "<?php echo "AudioFiles/".$a; ?>"
});
$(this).bind($.jPlayer.event.play, function() {
$(this).jPlayer("pauseOthers");
});
},
solution:"flash,html",
swfPath: "jquery",
supplied: "<?php echo $info['extension'];?>"
});