NYCPHP Meetup

NYPHP.org

[nycphp-talk] ajax and un-breaking the ol' back button

John Campbell jcampbell1 at gmail.com
Wed Apr 2 13:07:29 EDT 2008


On Wed, Apr 2, 2008 at 12:28 PM, csnyder <chsnyder at gmail.com> wrote:
> On Wed, Apr 2, 2008 at 9:53 AM, David Mintz <david at davidmintz.org> wrote:
>
>  > Before I start trying to un-break it please tell me if this logic is sound:
>  > when they do an ajax request, store the query params in the session.
>  > Whenever they GET the page itself, look first for these session vars and use
>  > them if they exist, else use the defaults.
>  >
>
>  That's probably the easiest way to do it, if you're already using sessions.
>
>  You could also use js to write the current params directly to cookie.

Back button navigation is specific to the window... cookies/sessions
are 1 per browser instance.  You will have a mismatch, but it may be
one you can live with.  The best way to do it is to save the query
parameters in the address bar.  In gmail, the page view information is
saved after the '#' sign.  Take a look at the jquery history plugin.



More information about the talk mailing list