It looks like what you're looking for is something like PJAX .
To be clear, the HTML5 History API (which implements History.js / gaskets) does not support the direct state of your application. Rather, it provides a mechanism for mapping changes to the window URL of the function responsible for actually displaying the changes. readme offers some insight into how this can be achieved:
History.Adapter.bind(window, 'statechange', function() {
var State = History.getState();
History.log(State.data, State.title, State.url);
});
If instead of registering the state you want to change the contents of the container (without using PJAX or a similar library), you can instead save the contents #containerwith each call pushStateand configure the handler function to do something like this:
History.Adapter.bind(window, 'statechange', function() {
var State = History.getState();
$('#container').empty().append(State.data.content);
});
History.pushState({content:"Hello, world!"}, "State 1", "?state=1");
Of course, you will need to change this to reflect the specifics of your situation.
source
share