JQuery & history.js back button not working

前端 未结 2 676
醉话见心
醉话见心 2020-12-14 09:54

I\'m using history.JS (latest) with Jquery (latest) to load and replace just a portion of a website, this is all working, currently I\'m only trying to get it working in mod

2条回答
  •  悲哀的现实
    2020-12-14 11:00

    You are correct when you say that you need to reload the data when the state changes, in that you will have to have the javascript undo the changes made or render the contents again from the original state.

    This will probably better suit your agenda: https://github.com/thorsteinsson/jquery-routes

    Edit:

    You might also consider using backbone.js (http://backbonejs.org/) as it will help you create structure and abstract code in a way that makes it easier to understand what needs to be done.

    Backbone comes with it's own url router and so called views.

提交回复
热议问题