views:

203

answers:

1

Dear all,

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.

A: 

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

rbaker86
Thanks for your reply, I think Ajax need to use back JS to do back the mechanism. Thank you guys!
Shiro