Question about ajax filtering

Hi,

We have a filter that lets the user filter between different options in a list and then dynamically shows the results with ajax. But, If a user choose one of the results and so beeing directed to a new page, but then decides to hit the browser back-button, the results and filter is reset. Is there any way to make it not reset when hitting the back-button?
Im aware i’m not supplying you guys with any code here just wondering if there is some general solution to stuff like this.

Yes, you can update the fragment identifier on the url to represent different filters, which are used in the page history.

1 Like

Hmm sounds advanced in my ears, could you point me in the right direction?=)

Sure thing. When the page loads, check if there is a fragment identifier. If there isn’t then keep loading as per normal.

If you’re using jQuery then a nice hash change event plugin exists, which fires a callback whenever the hash changes. This allows you to check what the changed has is (which occurs when going back a page) and deal with things based on the existing state of things.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.