473,715 Members | 6,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to refresh a parent frame from a pop up?

I am working on updating a Web site with a frameset. A page opens a
pop-up window in which the user uploads pictures. Once the upload is
done, I would like to refresh the content of the frame which opened the
pop-up but so far have failed. Here is my code:

<%

(ASP code which saves the photo in a database)

%>
<HTML>
<head>
<script language="javas cript">
var url = top.parent.wind ow.opener.docum ent.all.MYURL.i nnerHTML +
'?ADID=<%=pintA DID%>&MODE=S1&V IEWMODE=2';
top.parent.wind ow.opener.locat ion.href = url;
top.parent.wind ow.close();
</script>
</head>
<body></body>
</html>
What I am trying to do is simply refresh the parent window with the
same URL. The ?ADID=<%=pintAD ID%>&MODE=S1&VI EWMODE=2' portion is there
to ensure that the browser does not refresh without the parameters.

Thanks a lot for your help!

Jul 23 '05 #1
3 10603
ni****@yahoo.co m wrote:
I am working on updating a Web site with a frameset. A page opens a
pop-up window in which the user uploads pictures. Once the upload is
done, I would like to refresh the content of the frame which opened the
pop-up but so far have failed. Here is my code: .... var url = top.parent.wind ow.opener.docum ent.all.MYURL.i nnerHTML +
'?ADID=<%=pintA DID%>&MODE=S1&V IEWMODE=2';
top.parent.wind ow.opener.locat ion.href = url;
top.parent.wind ow.close(); ....
Does the popup have a frameset?
If not, you could do this:

var url = (
opener.document .getElementById ?
opener.document .getElementById ( 'MYURL' )
: opener.document .all.MYURL
).innerHTML + '?ADID=<%=pintA DID%>&MODE=S1&V IEWMODE=2';

// if the location is already the url, just reload
if( opener.location .href == url )
opener.location .reload();

// otherwise, nagivate to said url
else
opener.location .href = url;

window.close();
</script>
</head>
<body></body>
</html>
What I am trying to do is simply refresh the parent window with the
same URL. The ?ADID=<%=pintAD ID%>&MODE=S1&VI EWMODE=2' portion is there
to ensure that the browser does not refresh without the parameters.


See above.

The code above is missing some compatibility checks for brevity's sake.

Also, in some circumstances it is a bad a idea to print the URL into
the page without first doing some translation of it. I don't know how
you're putting the URL in the page itself (i.e. whether you're building
the URL from scratch, doing any translation, or just dumping it into
the output), but be aware of any possible security considerations, as
this will allow users to essentially edit the code of the page that is
displayed and cause the browser to interpret the code in the context of
your domain name.

You may also want to check that the parent window is still relevant to
the popup, prior to trying to work with it.

Jul 23 '05 #2
Thanks. I am only taking over some sloppy development done prior to me. The
job is to get something to work, without reprogramming everything. The
client already spent a fortune for a Web site which does not function
properly.

I am not the best Javascript programmer out there, because I never really
spent a lot of time learning the compatibility issues.

Is this code MSIE-only? What would also work with Mozilla/Firefox and
Safari?

Thanks a lot for your help!

"Random" <ra*******@gmai l.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
ni****@yahoo.co m wrote:
I am working on updating a Web site with a frameset. A page opens a
pop-up window in which the user uploads pictures. Once the upload is
done, I would like to refresh the content of the frame which opened the
pop-up but so far have failed. Here is my code:

...
var url = top.parent.wind ow.opener.docum ent.all.MYURL.i nnerHTML +
'?ADID=<%=pintA DID%>&MODE=S1&V IEWMODE=2';
top.parent.wind ow.opener.locat ion.href = url;
top.parent.wind ow.close();

...
Does the popup have a frameset?
If not, you could do this:

var url = (
opener.document .getElementById ?
opener.document .getElementById ( 'MYURL' )
: opener.document .all.MYURL
).innerHTML + '?ADID=<%=pintA DID%>&MODE=S1&V IEWMODE=2';

// if the location is already the url, just reload
if( opener.location .href == url )
opener.location .reload();

// otherwise, nagivate to said url
else
opener.location .href = url;

window.close();
</script>
</head>
<body></body>
</html>
What I am trying to do is simply refresh the parent window with the
same URL. The ?ADID=<%=pintAD ID%>&MODE=S1&VI EWMODE=2' portion is there
to ensure that the browser does not refresh without the parameters.


See above.

The code above is missing some compatibility checks for brevity's sake.

Also, in some circumstances it is a bad a idea to print the URL into
the page without first doing some translation of it. I don't know how
you're putting the URL in the page itself (i.e. whether you're building
the URL from scratch, doing any translation, or just dumping it into
the output), but be aware of any possible security considerations, as
this will allow users to essentially edit the code of the page that is
displayed and cause the browser to interpret the code in the context of
your domain name.

You may also want to check that the parent window is still relevant to
the popup, prior to trying to work with it.

Jul 23 '05 #3
So far as I know it should work in most relatively modern browsers.
Expect compatibility issues with older versions of Netscape that few
people still use, and probably other older, less-used agents.

Nicolas Verhaeghe wrote:
Thanks. I am only taking over some sloppy development done prior to me. The
job is to get something to work, without reprogramming everything. The
client already spent a fortune for a Web site which does not function
properly.

I am not the best Javascript programmer out there, because I never really
spent a lot of time learning the compatibility issues.

Is this code MSIE-only? What would also work with Mozilla/Firefox and
Safari?

Thanks a lot for your help!

"Random" <ra*******@gmai l.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
ni****@yahoo.co m wrote:
I am working on updating a Web site with a frameset. A page opens a
pop-up window in which the user uploads pictures. Once the upload is
done, I would like to refresh the content of the frame which opened the
pop-up but so far have failed. Here is my code:

...
var url = top.parent.wind ow.opener.docum ent.all.MYURL.i nnerHTML +
'?ADID=<%=pintA DID%>&MODE=S1&V IEWMODE=2';
top.parent.wind ow.opener.locat ion.href = url;
top.parent.wind ow.close();

...
Does the popup have a frameset?
If not, you could do this:

var url = (
opener.document .getElementById ?
opener.document .getElementById ( 'MYURL' )
: opener.document .all.MYURL
).innerHTML + '?ADID=<%=pintA DID%>&MODE=S1&V IEWMODE=2';

// if the location is already the url, just reload
if( opener.location .href == url )
opener.location .reload();

// otherwise, nagivate to said url
else
opener.location .href = url;

window.close();
</script>
</head>
<body></body>
</html>
What I am trying to do is simply refresh the parent window with the
same URL. The ?ADID=<%=pintAD ID%>&MODE=S1&VI EWMODE=2' portion is there
to ensure that the browser does not refresh without the parameters.


See above.

The code above is missing some compatibility checks for brevity's sake.


Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1683
by: Adrian | last post by:
Hi, I Need help. This is my situation right now. I have a page which contain 2 frame. On the 1st frame which contain a header and a drop down box and the 2nd frame contains information. I would like to know how to refresh a whole page from a click of a button which will then refresh a new value base on Session ID??
1
5970
by: tony wong | last post by:
the page has upper frame (submit record) and lower frame (show records). i wish to refresh lower frame once submit record at upper frame. i try this, it works to refresh the lower frame function ABC() { window.parent.mainFrame.location.reload();} <input type="button" value="refresh" onclick="return ABC()"></TD>
1
4728
by: Helixpoint | last post by:
I have a frameset. left and main. Inside the main frame I have a IFRAME. I need to refresh the main frame when I post a form inside the IFRAME. I am trying the code below with no luck?? Private Sub addMachine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addMachine.Click Dim sScript As New System.Text.StringBuilder sScript.Append("<SCRIPT language=""javascript"">" & vbCrLf)
2
23503
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 iframe on my page whose html has the refresh meta as follows : <meta http-equiv="refresh" content="10"> The iframe is effectivelyh refreshed every 10 seconds without having the
8
2863
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 authentication and think I know how to accomplish this part. My problem is that the top frame does not reload to get to the "If User.Identity.IsAuthenticated Then". Please don't tell me I shouldn't be using frames; this is a school assignment and the...
3
2109
by: Kevin | last post by:
Hi guys, I want to refresh some pages every 2 seconds. however, these html pages are not in my site, they could be any pages from yahoo.com or msn.com. I can create a page, which redirect to public internet html page, but how can I do this in a loop? do I need to write a console application to make it work? thanks
1
7280
by: monkeys paw | last post by:
I have a web page with four frames in it. If, within one of the frames, i use a javascript function to do something like: window.location = "app.cgi" Only the frame that contains the JS will refresh. I need to refresh all four frames from within one. How do I do that??
10
35931
by: markwalker84 | last post by:
Hello everyone! Got a bit of a problem... Two of the panels on my program contain a number of check boxes. The exact number of which is determined by a pair of variables. I have recently implemented a Wizard which changes that number, as well as a save and load function to the program. I know the number of being altered in memory (i added a quick check button) but what i'm struggling with is how to refresh the panel with the new...
0
8718
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9340
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9196
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5967
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3175
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2539
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2118
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.