jPlayer generates a playlist with <li>'s.
For tracks missing names, I just want to show "track #" rather than a blank li.
This should be easy, right? Change:
listItem += "<a href='javascript:;' class='" + this.options.playlistOptions.itemClass + "' tabindex='1'>" + media.title + (media.artist ? " <span class='jp-artist'>by " + media.artist + "</span>" : "") + "</a>";
to
... + (media.title=="" ? "Track "+ $(this).index('li') : media.title ) + ...
But whatever I do, be it $(this).index() or $(this).index('li') etc, it always comes back with -1.
Can anyone with better jquery skills let me know where I'm going wrong? Thanks!