1
我有这个脚本,我想播放名称为'pr_id'的歌曲,我该如何将它写入路径中?谢谢!如何在路径中传递变量
$(document).ready(function(){
var pr_id = document.getElementById('id')
$("#jquery_jplayer_1").jPlayer({
ready: function(){
$(this).jPlayer("setMedia", {
mp3:"/sounds/[pr_id].mp3"
});
},
swfPath: "js",
supplied: "mp3",
wmode: "window"
});
});
你要找的术语是“字符串连接”。 – meagar 2013-03-13 13:22:38