Error about div In Section 5 Fetch a Sound to play


#1

I get this: Oops, try again. Set the div#player to the track title
I don’t see anything wrong.

<!doctype html>
<html>
    <head>
        <script src="//connect.soundcloud.com/sdk.js"></script>
        <script src="script.js"></script>
    </head>
    <body>
        <div id="player"></div>
    </body>
</html>

and the code:

SC.initialize({
  client_id: '340f063c670272fac27cfa67bffcafc4'
});

$(document).ready(function() {

    SC.get('/tracks/293', function(track) {
      $('#player').html(track.title);
    });

});

#2

sounds like the old learning environment, can you share the exercise url to confirm this for me?


#3

Thanks, here it is:

https://www.codecademy.com/en/courses/javascript-intermediate-en-txGOj/1/2?curriculum_id=50ecb9bedc5e3250c40000c6

The html preview actually does display “Flickermood” which I assume is the name of the track.


#4

its the old learning environment, which is no longer maintained. As such, taking the course is on your own risk i am afraid. Let me see what i can dig up


#5

How do I get to the new one?


#6

there isn’t a new version of soundcloud api, all the supported courses are featured on the main site:

http://codecademy.com/


#7

OK that’s fine. Thanks for letting me know. Cheers!


#8

wow, cheating was easy:

<!doctype html>
<html>
    <head>
        <script src="//connect.soundcloud.com/sdk.js"></script>
        <script src="script.js"></script>
    </head>
    <body>
        <div id="player">Flickermood</div>
    </body>
</html>

we just hard code the value for a second. But you can expect more bugs like this down the line, is it really worth it? Why not learn jquery/JS in a supported course, and then find a supported soundcloud api course on another site?