This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Zach Gavin
almost 9 years

Want to post link to track on page

So I’m making a soundcloud app, and I’m using the method/code in this lesson for the most part:

SC.get("/tracks/138084493", function(track) {
    $('#track').append(
        $('<a id="tracklink"></a>').html(track.title)
    );
});

This display the name of the soundcloud track in the div that I want, but I also want the name to be a link to the original track page. This link can be grabbed just like I grabbed the title,

track.permalink_url

but I’m not sure how to code it - perhaps something like

$('#tracklink').href = "track.permalink_url";

That line specifically doesn’t actually work, but I’m thinking it has to be something like that?