jQuery Address

Posted: 2013-01-14 07:50:00
Simple example of jQuery.address in use. As you click the top "black" menu area the pages will load via Ajax (and title) notice also the URL. Then if you click back it forces a reload. There is very little code needed to make this work. Other than the ajax callback I run this on page load (eg pressing back on the browser button)
 //Jquery Address clicking back
    if($.address.value() !== '/') {
The externalChange reacts to the page load or back button and runs this function(s). In this case I run a function and pass the path to it. All that function does is run jQuery.ajax based on the path and lastly


and this updates the path. That is it. One other thing is I set the state to


This made it possible to remove the # from the url.