This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Using the SoundCloud API Forum

View Course » View Exercise

120 points
E0cf455ad112c8db86bd578bcc72c7ca?s=140&d=retro
Submitted by
Amy Robinson
almost 3 years ago

My code is wrong so why is it being accepted?

I know it's wrong because I didn't do the following:

Add a single line of code to the function that sets the contents of the #comment element to comment[0].body.

Here's my script.js which was accepted:

SC.initialize({
clientid: 'YOURCLIENT_ID'
});

$(document).ready(function() {
SC.stream('/tracks/293', {
autoPlay: true,
ontimedcomments: function(comment) {
$('ontimedcomments', function(comment) {
$('comment')
});
}
});
});


0 votes

permalink

Same here.

Never too late for an answer i guess.

Here's what i sent:

SC.initialize({
  client_id: 'YOUR_CLIENT_ID'
});

$(document).ready(function() {
  SC.stream('/tracks/293', {
     autoPlay: true,
     ontimedcomments: function(comment) {
            $('#comment').html(comment[0].body);
     } // add the callback function here
  });
});

I don't know if that bit is correct though. My guess being that it isn't since it doesn't output anything in the preview frame. But the code gets validated nevertheless when submitted instead of displaying an helpful error message :(

1185 points
Bce180d619315eb6c7a657d0fa795a0d?s=140&d=retro
Submitted by
Arthur
over 2 years ago