How to print a var inside a script

Posted by Pollux Khafra on Stack Overflow See other posts from Stack Overflow or by Pollux Khafra
Published on 2012-08-31T21:35:32Z Indexed on 2012/08/31 21:37 UTC
Read the original article Hit count: 285

Filed under:
|

Alright I'm trying to use a jplayer script to trigger the player in my template. I need to pass a value to the "mp3" option but I don't get how I get $music to print.

$(document).ready(function(){
  $("#jquery_jplayer_1").jPlayer({
    ready: function () {
      $(this).jPlayer("setMedia", {
        var music = $(".album-playlist li").first().find("input").val();
        mp3: $music,
      }).jPlayer("");
    },
    swfPath: "http://mysite.com/wp-content/themes/beta/libs",
    supplied: "mp3"
  });
});    

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jplayer