Now you need to make the necessary changes to your div inside the $.address.change() event in order to switch to the desired state, all page state changes will go inside this event.
In the jquery address, you need to perform two main tasks: first, so that your links change the value of the deep binding, using events like you, but forcing them to update the $.address.value(value_here) method; and secondly, catch all the changes using the change() event to apply changes to the state of your page.
You can also use the value() attribute to determine the correct state, e.g.
$("a").onClick(function () { //You dont need this part if you used $address.value($(this).attr('href')); //the 'rel' attribute in the links }); $.address.change(function(event) { //Catching URL change in `event` $.ajax({ //You said you're using AJAX so url: "."+event.value+".html", //using `value` attr. to get the URL+html cache: true, success: function(response) { $("#content_div").html(response); //loading page in div using AJAX } }); });
this is just an example, you can use it to load your pages in any other way, since $.address.value() returns the value after # , this is your deep binding value.
Once you do this, the Back and Forward buttons will change the URL of the page, the change() event will catch this, and your page will work as expected.
So basically you need to develop a certain level of understanding of how the jquery address works and work with this code. Also on the dquery address docs docs page is a list of all methods and events if you forget about them.
source share