Save frames state before refresh

Imagine diving into a framed site and surf around abit. You've drilled to a page you are interested in and for one of many possible reasons (script failed...timed out search ... whatever) you hit page refresh.

The site returns to the opening page.

You swear.

Is it possible to save the state of frames...specifically, currently loaded filenames and so as to restore them if refresh is hit.

If it matters, this will be used on an ASP-based site and I wouldn't be surprised if there's an onRefresh event for IE but we'll be serving NS folk as well.

Who is Participating?
dmaryakhConnect With a Mentor Commented:
One possible solution might be in saving frame information (s.a. url of each frame loaded) into the cookie and updating this cookie info as each frame is being loaded. Your frame set doc would have to check if such cookie exists and if YES, then reconstruct the frameset using URLs in the cookie, and if NOT then use default URLs

This solution can be implemented on client or server (since you use ASP).
place this code into the desired frames

<a href="javascript:location.reload()" target="_self">*desired word*</a>

it might be much to place it in each frame but its a thought and does work specifically for each frame.

juststeveAuthor Commented:
Thankx for the reply morbiusx. The way I read it your code will allow a link to reload the the given frame when a user clicks it.

What I need to deal with is the instance when a user clicks the browser's 'Refresh' button. Currently, all frames reload to the original locations. Problems arise because the user may find it difficult to re-navigate to the page they had been viewing so I want to trap the 'Refresh' button in kinda the same way as trapping the 'Back' button.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.