JQuery Histroy-js Need Help

JQuery Histroy-js Need Help


I have some logic in the form which making my submit button #signup-bb disable=false and setting some values to #total-bb. So basically whats happens: after user choosing subscription plan and some options, submit button #signup-bb getting enabled and the price getting calculated and value assigned to #total-bb. Then when user clicking #total-bb he coming to another page. Then if user clicks browser history back button he coming to previous page with subscriptions but the state of this page is not the same it was before he click submit button: button #signup-bb disabled and there is no value in #total-bb. I decided to use this plugin http://plugins.jquery.com/project/history-js to update history on button click:

    <script>
       
(function (window, undefined) {
           
...
            $
(document).ready(function () {
               
...
                $
("button, input:submit", ".subscription").button();

                $

("button, input:submit").click(function () {
                   
var History = window.History; // Note: We are using a capital H instead of a lower h
                   
History.Adapter.bind(window, 'statechange', function () { // Note: We are using statechange instead of popstate
                       
var State = History.getState(); // Note: We are using History.getState() instead of event.state
                       
History.log(State.data, State.title, State.url);
                   
});

                   

History.pushState($("#plan"), "plan", "?plan=1");
               
});

           

});
           
...
       
})(window);
   
</script>


<div id="plan">
     
<div id="total-bb">&nbsp;</div>    
     
<button value="1" name="submit" disabled="true" id="signup-bb">Sugn up</button>
<div>

Heed Help.