views:

344

answers:

3

I have a simple flow

A.html -> B.html -> C.html

Now, B either 302's to C, or shows a progressbar, and then after some ajax call is done goes to C. When the user is on C, and they hit "Back" I want them to end up on A instead of B.

If the page 302ed, then the back behavior is what I want, but otherwise they get that intermediary page. Any way to solve this easily?

+1  A: 

Use ajax in A to load B into A.

frankster
A: 

Nope. That's a function of the browser itself, and not something generally exposed to the page's desires. You'd be better off having page A do an AJAX call instead of loading page B in the main window at all.

Amber
+4  A: 

Presumably when the Ajax is done you are using:

location.href = "http://example.com/c";

Change that to:

location.replace("http://example.com/c");
David Dorward
Worked great. Thanks!
Paul Tarjan