0
我想添加動態數據到這個JavaScript。 那麼如何做到這一點?如何在JavaScript中動態添加項目?
$(document).ready(function(){
new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_2",
cssSelectorAncestor: "#jp_container_2"
}, [
{
title:"Do Pag Mar aur Bhul Ja",
mp3:"http://download.apunkabollywood.us/songs/Audio/indian/movies/One Night Stand (2016)/01 - Do Peg Maar - Neha Kakkar @ fmw11.com.mp3",
},
{
title:"Your Face",
mp3:"http://www.jplayer.org/audio/mp3/TSP-05-Your_face.mp3",
oga:"http://www.jplayer.org/audio/ogg/TSP-05-Your_face.ogg"
},
{
title:"Cyber Sonnet",
mp3:"http://www.jplayer.org/audio/mp3/TSP-07-Cybersonnet.mp3",
oga:"http://www.jplayer.org/audio/ogg/TSP-07-Cybersonnet.ogg"
}
], {
swfPath: "musicPlayerfiles/dist/jplayer",
supplied: "oga, mp3",
wmode: "window",
useStateClassSkin: true,
autoBlur: false,
smoothPlayBar: true,
keyEnabled: true
});
});
[追加到陣列(http://stackoverflow.com/questions/351409/appending-to-array) – Tibrogargan
見[Array.prototype.push()](HTTPS的可能重複: //developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/push);如何在JavaScript中添加數組 – cdaiga
您想要添加的數據來自哪裏? – nnnnnn