Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parent refreshes, need querystring?

Status
Not open for further replies.

DebbieDavis

Programmer
Jun 7, 2002
146
US
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? It needs to reload, but it needs to jump to a particular anchor on the page. Any way to modify the above code to accomplish this? Thanks.
 
Since it's in an ASP page, why not use a session variable to keep track of whether or not it's being reloaded after the popup closes? In your popup page set the session variable:

Code:
<% Session("reloaded") = true; %>

And then in your main page upon reloading:
Code:
<%
if (Session("reloaded")) {
   Response.Write("<body onload='jump to anchor'>");
   Session("reloaded") = false;
}
else {
   Response.Write("<body>");
}
%>

Sorry about the server side JScript, I never use VBScript for coding server side, so I couldn't provide you with an example, shouldn't be too hard to convert though


-kaht

banghead.gif
 
That's probably a good idea. I'll give it a try. Many thanks for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top