Skip to content

Instantly share code, notes, and snippets.

@tbleckert
Created June 18, 2010 14:27
Show Gist options
  • Save tbleckert/443696 to your computer and use it in GitHub Desktop.
Save tbleckert/443696 to your computer and use it in GitHub Desktop.
$('a').each(function(){
var url = $(this).attr('href');
var element = $(this);
$.getJSON("http://json-tinyurl.appspot.com/?&callback=?", {url: url}, function(data){
$(element).attr('href', data.tinyurl);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment