Close and refresh with bookmark?

T

Targa

After I submit a form from a popup window, I use the following code to close
the popup and refresh the parent window.

<a href="#" onclick="window.opener.location.reload();self.close();return
false;">

The link to the popup window is at the bottom of the parent page (long) and
I jump to it with a bookmark. Currently, after the refresh occurs, the
parent page ends up back at the top. Is there a way to adjust the above code
(or use a different method) to go back to the bookmark when the parent is
refreshed?

Thanks in advance!!!
 
V

Vincent van Beveren

Hi Targa,
The link to the popup window is at the bottom of the parent page
(long) and I jump to it with a bookmark. Currently, after the refresh
occurs, the parent page ends up back at the top. Is there a way to
adjust the above code (or use a different method) to go back to the
bookmark when the parent is refreshed?

I assume with bookmark you mean the history of that browser window. No
there is no good way of doing that, because calling a history.back()
after the location.reload() has happend won't work. However, what you
might be able to do is not reload the page, but request the URL again,
but use a # to jump to the link.

window.opener.location.href='mypage.html#popup';

All you need to do is give the a name to your link on the bottom:

<A HREF="#" NAME="popup" ...>Blah</A>

And when the parent is reloaded it should jump to the original link
for the popup window.

Good luck,
Vincent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top