Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JavaScript
branch: master

This branch is 1 commit ahead, 312 commits behind asual:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
dist
lib
samples
src
test
GPL-LICENSE
MIT-LICENSE
README.md
build.properties
build.xml

README.md

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:

  • Bookmarking in a browser or social website
  • Sending links via email or instant messenger
  • Finding specific content using the major search engines
  • Utilizing browser history and reload buttons

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="/deep-link" data-url="address:/deep-link">Deep link</a> 
Something went wrong with that request. Please try again.