Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Converting HTML links to SoundCloud widgets using JQuery
// if you have a link in your HTML that points to a sound: <a href="http://soundcloud.com/matas/hobnotropic">My Track</a>
// it will convert them to our new HTML5 widgets
$('a[href*="soundcloud.com"]').each(function(){
var $link = $(this);
$.getJSON('http://soundcloud.com/oembed?format=js&url=' + $link.attr('href') + '&iframe=true&callback=?', function(response){
$link.replaceWith(response.html);
});
});

wonderful, worked like a charme. Thank you very much!

gtraxx commented Jul 2, 2013

Thank you very much! ;)

kplates commented Sep 5, 2013

word up! very cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment