473,395 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Refresh parent window with querystring or replace it?

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
1 11053
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andrew Alger | last post by:
ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button on Customer.aspx that when executed runs javascript code to open up parent_search as a popup. After the user searches...
3
by: DCB | last post by:
Hello. I have an easy question, likely, that has me in a headspin. I have an include file to a frames based site that basically forces frames on the end user if they visit the site and hit a...
4
by: Max Dupenois | last post by:
I've seen numerous articles with similair (similar sp?) titles to this in my search.. unfortunately none of them seem to contain what i want, (or if they do i need someone to point out my stupidity...
2
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent...
2
by: Jeronimo Bertran | last post by:
Hi, I have a page with a very data intensive grid which needs to be automatically refreshed constantly if a change is detected. In order to not refresh the complete page so often, I created an...
8
by: Judy Ward | last post by:
I have an index.aspx with frames. The top frame has a navigation bar with a "Login" hyperlink. If the user has already logged in I want this link to change to "Logout". I am using forms-based...
5
by: Peter | last post by:
1) I have a C# web application and what I am trying to do is create a popup window from a link on the parent window 2) the popup window will have a button and when a user clicks on the button the...
2
by: Bruno | last post by:
Hi ... I have a webpage popup (lets call it POPUP) which refreshes the opener window (this one we call PARENT) when we close it, saying we want to save data. For this, we use ...
2
by: Dave | last post by:
I only do ASP part time so this is a beginner question. I will attempt to make this a starightforward question... Is there any technique to keep values a user types into databound controls...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.