Link to home
Start Free TrialLog in
Avatar of robinh583
robinh583Flag for United States of America

asked on

Browser back without data reloading

I have three web pages: A, B, and C. A can be scrollable and has a control to go to B. B allows you to click to C. If I enter data on A (but don't save it), click to B (which is the same window), click to C (which is a new window), cancel in C, which closes C and therefore shows B untouched, cancel in B and return back to A, I lose my changes on A, as A refreshes its data.

In other words: A>B>(new window C)>B>A

I'm using window.location = "javascript:history.go(-1);" to go back to A.

Is there a way to go "back" to A, preserving its scroll location, data, and NOT refresh?

Thanks!

...Robin
ASKER CERTIFIED SOLUTION
Avatar of mrwebdev
mrwebdev

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I guess that last link could do it. Theres no way of getting this to happend if you dont save the data in some way.. either by passing it as variables, session objects, or formpassing.
Avatar of robinh583

ASKER

Thanks! This seems pretty close, but the specific problem is that page "C" is in a new window.

If I fill in page "A," don't save but jump to "B" (which is in the same window and which I get to by clicking a URL that is set up to "look" like a button) and then return back to "A," everything's fine. The problem is when "B" opens a new window (which is gotten to via a true button click), no matter what that window does. When I go back to "B" (either leaving "C" open or closing it), "B" is exactly as it was before I opened "C" and is fine. HOWEVER, when I close "B", "A" somehow is forced to refresh and reloads it's data from my DB.

If I had only gone from "A" to "B" and back, no refresh is done and life is happy happy happy.

One sidebar issue (not sure this makes a difference or if there's a better way to do this): the reason "A" gets to "B" via a URL dressed up to look like a button is that "A" is a long list of questions (from a DB read), each of which can optionally go to a "comments" page related to that question. We need the jump to be done via a button but could not figure out how to populate all of the buttons with the proper params it needs to pass to the comments page so that page can see what question it needs to collect comments on.

Thanks for all your thoughts, suggestions, and guffaws.

...Robin