javascript - How shuffle a file (which contains an array) before using it? -
javascript - How shuffle a file (which contains an array) before using it? -
i using std mp3 player in webpage. javascript function includes next line:
<param name="flashvars" value="playlist=http://..../mp3_playlist.txt" />
the file contains array of mp3 file names (separated new lines).
i want shuffle playlist changes each time it's visited.
so added shuffle function:
var plist = new array(); $.get('http://..../mp3_playlist.txt', function(data){ plist = data.split(/\r\n|\r|\n/); plist = shuffle(plist); });
what syntax should utilize insert array ref function instead of file name? help.
javascript arrays
Comments
Post a Comment