Dynamically populate playlist with JSON from PHP in jPlayer
问题 I have a PHP that create a JSON array of mp3 files in a directory. The JSON array output from PHP is : [{"title":"Kalimba","mp3":"/path/to/mydirectory/Kalimba.mp3"},{"title":"Maid with the Flaxen Hair","mp3":"/path/to/mydirectory/Maid with the Flaxen Hair.mp3"},{"title":"Sleep Away","mp3":"/path/to/mydirectory/Sleep Away.mp3"}] Fine, it seems to be what is expected by JQuery.jPlayer. Now in a basic jplayer.js file I have : $(document).ready(function(){ new jPlayerPlaylist({ jPlayer: "#jquery