Execute when address change has been commited in jQuery Address

Exchange

New Member
Considering the example on here or see below. How do you execute a function when the url change has been committed (everything in .change is executed) so you could do \[code\]alert('new url is:'+$.address.baseURL() +'and has the title'+$.address.title())\[/code\]. I was thinking of attaching .done(function(){}) after the .change() event but that didn't seem to work... I'm not sure how to implement $.when(function()).then(function()); here\[code\] $.address.state('/jquery/address/samples/state').init(function() { // Initializes the plugin $('.nav a').address(); }).change(function(event) { // Selects the proper navigation link $('.nav a').each(function() { if ($(this).attr('href') == ($.address.state() + event.path)) { $(this).addClass('selected').focus(); } else { $(this).removeClass('selected'); } }); if (state && init) { init = false; } else { // Loads the page content and inserts it into the content area $.ajax({ url: $.address.state() + event.path, error: function(XMLHttpRequest, textStatus, errorThrown) { handler(XMLHttpRequest.responseText); }, success: function(data, textStatus, XMLHttpRequest) { handler(data); } }); } });\[/code\]
 
Back
Top