Forum Moderators: open

Message Too Old, No Replies

Revisionist History

Hack the Back

         

cmarshall

7:53 pm on Jun 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have an AJAX application.

As everyone knows, AJAX and the Back Button don't get along well.

I have a hack that uses a session to keep up to date state, so I can simulate a back button.

However, this is awkward, and doesn't work when I call outside the site.

Is there a way to "revise history," so that the next page's "Back" button will have a URI that will contain parameters I can use to establish state?

cmarshall

2:32 am on Jun 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just to be clear, I can do this with cookies, but I have to adjust our privacy policy if I do (it already accounts for the session). I just wanted to see if I could avoid that.

I can probably make the session work, but a cookie is easier (I'm not sure how to access a session in JavaScript).

I don't think that this is possible without cookies or sessions.

Tastatura

2:50 am on Jun 4, 2007 (gmt 0)

10+ Year Member



take a look at this thread and links provided by me an encyclo

[webmasterworld.com...]

hth

cmarshall

2:59 am on Jun 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good point. I'll look at your link [onjava.com], but I'll lay odds it's cookie-based.

[update]No, I'm wrong, but it ain't a simple solution. I may actually be better off using cookies.[/update]

I completely agree that "Accessible AJAX" is an oxymoron.

However, there is no choice, here.

The AJAX in question is the Google Maps API [google.com].

The maps implementation is a "luxury" implementation that accompanies a far more spartan (and accessible) implementation. I am mostly aiming for usability here, more than accessibility.

[update 2][duh]Sessions are server-based. Can't get there from here.[/duh][/update 2]

Tastatura

3:49 am on Jun 4, 2007 (gmt 0)

10+ Year Member



Since you are dealing with G Maps API this might (or not :) ) be of some help - depends what you are trying to do...
If you want "back button" or ability to bookmark specific location you might be able to set up your page such that it doesn't reload into itself and has URI of the form:

example.com/mappage.html?address=555%20Any%20street

this *should* enable bookmarking specific location that user entered into search form (that is if you have it). Also if there were multiple search queries entered you can use back button to go to them.

This solution won't work if user enters location, moves map around and wants to bookmark current position on the map...

Again not sure what exactly you want to do so...