jQuery on the fly URL shortener

Here is an example how to get a shortened URL with Bitly API and jQuery: function get_short_url(long_url, login, api_key, func) { $.getJSON( “http://api.bitly.com/v3/shorten?callback=?”, { “format”: “json”, “apiKey”: api_key, “login”: login, “longUrl”: long_url }, function(response) { func(response.data.url); } ); } The following code could be used to get a short URL: /* Sign up for Bitly … Read more