asual / jquery-address

jQuery Address - Deep linking for the masses
http://www.asual.com/jquery/address
GNU General Public License v2.0
813 stars 172 forks source link

jQuery Address

The jQuery Address plugin provides powerful deep linking capabilities and allows the creation of unique virtual addresses that can point to a website section or an application state. It enables a number of important capabilities including:

Usage

A basic implementation in pure JavaScript can look like this:

$.address.change(function(event) {  
    // do something depending on the event.value property, e.g.  
    // $('#content').load(event.value + '.xml');  
});  
$('a').click(function() {  
    $.address.value($(this).attr('href'));  
});  

The plugin also provides a jQuery function which can be directly used in the following way:

$('a').address();  

The above snippet can be extended with an additional function that processes the link value:

$('a').address(function() {  
    return $(this).attr('href').replace(/^#/, '');  
});  

By default the plugin automatically adds the appropriate JavaScript event handler to every link that has a rel attribute in the following format:

<a href="https://github.com/asual/jquery-address/blob/master/deep-link" rel="address:/deep-link">Deep link</a> 

Changes

01/22/2013 - jQuery Address 1.6

11/18/2012 - jQuery Address 1.5

05/04/2011 - jQuery Address 1.4

02/04/2011 - jQuery Address 1.3.2

11/29/2010 - jQuery Address 1.3.1

09/26/2010 - jQuery Address 1.3

07/19/2010 - jQuery Address 1.2.2

05/18/2010 - jQuery Address 1.2.1

05/05/2010 - jQuery Address 1.2

12/23/2009 - jQuery Address 1.1

04/28/2009 - jQuery Address 1.0

Initial release.