By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,940 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,940 IT Pros & Developers. It's quick & easy.

Refresh parent window with querystring or replace it?

P: n/a
Hi there, I'm not very good at javascript but I'm using the following
to close a child window and refresh a parent window after updating a
database. It's within an ASP page.

CODE
<SCRIPT>
function CloseWindow() {
if (window.opener && !window.opener.closed) {
window.opener.document.location.reload();
window.close();
}
}
</SCRIPT>

When my parent window reloads, is there any way to include a
querystring, or replace the parent with another URL? It needs to
reload, but it needs to jump to a particular anchor on the page. I do
not want to use session variables. Any way to modify the above code
to accomplish this? Thanks.
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Debbie Davis wrote:
Hi there, I'm not very good at javascript but I'm using the following
to close a child window and refresh a parent window after updating a
database. It's within an ASP page.

CODE
<SCRIPT>
function CloseWindow() {
if (window.opener && !window.opener.closed) {
window.opener.document.location.reload();
window.close();
}
}
</SCRIPT>

When my parent window reloads, is there any way to include a
querystring, or replace the parent with another URL? It needs to
reload, but it needs to jump to a particular anchor on the page. I do
not want to use session variables. Any way to modify the above code
to accomplish this? Thanks.


window.opener.location.href=window.opener.location .href + "#anchorName";

instead of reload(). Might be better to use
window.opener.location.replace() instead, so that the history trail
doesn't get too cluttered.
edit the anchorName as you need.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.