Does this work? $("#JPlayer").jPlayer({ ready: function() { var cookie = $.cookies.get("AlliedSkills.Player"); $(this).setFile($('#MusicPath').attr("value")) if (cookie == "Play") { $(this).play(); } }, swfPath: $('#JPlayerPath').attr("value") });
Note the '==' (not '='). On Wed, Dec 2, 2009 at 7:20 PM, shapper <mdmo...@gmail.com> wrote: > Hello, > > I have the following: > > $("#JPlayer").jPlayer({ > ready: function() { > $(this).setFile($('#MusicPath').attr("value")).play(); > }, > swfPath: $('#JPlayerPath').attr("value") > }); > > I would like the play the file: > $(this).setFile($('#MusicPath').attr("value")).play(); > > Only if ( $.cookies.get("AlliedSkills.Player") = "Play ) > > If ($.cookies.get("AlliedSkills.Player") is null then do not play and > set only the file: > $(this).setFile($('#MusicPath').attr("value")); > > Could someone please help me in doing this? > > Thanks, > Miguel >