ShortURL - Shortens Long URLs
Posted: Wednesday, March 07, 2007 10:53:45 AM | 1797 Views
ShortenURLs - Searches the page for hrefs and then shortens the length of the visible URL without effecting the actual linking itself. The script also allows the searching of specific page containers such as DIVs to limit the areas of the page that are updated. License:
Syntax:
- ShortenURLs(iLength,sAppend,bCheckAllowShortAttrib,sLinkContainer)
Parameters:
- iLength: the length you wish to shorten your URLs to.
- sAppend: the text you wish to append at the end of the visible URL. This will be appended to your URL at the length you specified so the URL will be iLength + the length of your append string.
- bCheckAllowShortAttrib: if set to true only hrefs with the attribute allowshort="true" will be shortened.
- sLinkContainer: only shorten links within this container. Default is the entire document
Directions
- Include the ShortenURL.js in your page <head>
- Call ShortenURLs in the onload even of your <body> tag.
Download
For examples of the script in action please view the readme.html included in the download. Or you can check it out here online and see it in action.
User Comments