• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

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?


1 Solution
Check this out as a solution, just an Idea.

Also look here for some other means of solutions:
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.
robinh583Author Commented:
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.


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now