Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $.getJSON('http://api.bandcamp.com/api/band/3/discography?key=[your_API_key]&band_id=1484946095&callback=?', function(albums) {
- $.post('./player.php', {disco_size: albums.discography.length },
- function(data){
- $('.players').append(data);
- if (check('.jp-jplayer')){
- $('.jp-jplayer').each(
- function(index) {
- $.post('./playlist.php', { album: albums.discography[index].album_id },
- function(playlist){
- new jPlayerPlaylist({
- jPlayer: "#jquery_jplayer_" + index,
- cssSelectorAncestor: "#jp_container_" + index
- }, playlist, {
- swfPath: "./js",
- supplied: "mp3",
- wmode: "window"
- }
- );
- $('.players').css("display","block");
- }, "json"
- );
- }
- )};
- }
- );
- });
- function check(element){
- if ( $(element).length > 0 ) {
- return true;
- }
- else{
- setTimeout(check(element), 100);
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement