Question

I would like to ask for how to redirect to previous page (ajax paging).

Example, Let's say currently I am in page 5, then I click on one record, after I edit it, I would like to go back to that page 5 not page 1.

The problem is my paging is using ajax,

http://domain/photo/#5

I try to use $_SERVER[http_referer], but I only get http://domain/photo , I not able to get # and the value.

What is the best way to redirect back to the previous paging. My last choice is using $_SESSION. Hope I can get better answer here.

Thx.

Was it helpful?

Solution

Like Lauri says, you need to manage this at the client-side using Javascript. Basically you need to implement some sort of client-side browser history. Just look at how Facebook loads in photos, but still lets you use the back button.

There are various libraries available to help you:

JS History Frameworks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top