There are a number of reasons why you might want a shorter version of a URL than the one of the page that you’re currently on-maybe you’re using a Twitter-like service with a short number of characters allowed, or maybe you’re going to paste the result into an email and you don’t want it to wrap. Either way, Script 17.12 makes it simple.
To shorten URLs:
Here we’re opening a new window, and using the TinyURL.com service to set our short URL. We pass it our current page location (found in location.href) and that’s all the information it needs. Because TinyURL.com immediately puts the new shortened URL onto your clipboard for ...