Documentation

jShortener Plugin Guide

Documentation on how to use Premium URL Shortener's jQuery plugin to shorten URLs on the fly.

jShortener Plugin Guide

The jQuery plugin is built for the Premium URL Shortener that is available at CodeCanyon. This will not work with any other URL shorteners and I will not implement it to other scripts. This is distributed freely to all of my customers who bought the script from CodeCanyon.

Basically, this little plugin uses jQuery to shorten URLs on your site using the API of your URL shortener. Before setting it up, you need to include the script 'urlshortener.js' using the following tag. You can put it before </head> or </body> (recommended). Don't forget the path if you uploaded it into a folder. Also don't forget to include the jQuery library.

Developers

If you know your way through the web console, then you can debug this plugin using that as errors are output directly to the console.

Javascript Version

The first thing you must do is to choose a selector. If you are not familiar with jQuery, you select elements using either the tag, id or class. For example $('a') will select all links or $('.style') will select all tags that have the “style” class. You can also use a child selector for example $('.comments a') or $('.comments').find('a).

The next thing you must do is to set up the URL to the your shortener. If you choose the javascript version then the URL to the API is simply http://YOURSITE.com. If you wish to distribute this plugin to your users, you can just add your URL in urlshortener.js (see below). You can just directly link the javascript file to your own server.

Finally, add your API key which you can get from http://YOUSITE.com/user (You must login before). Below is an example of usage. Here “http://google.com” will be replaced by the short URL automatically.

Full Example

If you have any questions, you can contact me via My Profile, Facebook Page or Submit a ticket.