473,546 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem reloading parent window

Hi all,

Here is my issue. I have a web page (lets call it page1) with an
iframe in it that then opens a pop-up window (page2). The pop-up
window is used to edit some data that was loaded into page1 so I want
to use onunload to reload page1 to keep the data synchronized.

At first I was using just

window.opener.p arent.location = window.opener.p arent.location;

and this worked fine.

Now I want to first set the text of page1, i.e.

window.opener.p arent.document. write('Contents Updated...reloa ding
page');

and then reload it.

So I now have the function:

function reloadInfoPage( )
{
window.opener.p arent.document. write('Contents
Updated...reloa ding page');
window.opener.p arent.location =
window.opener.p arent.location;
}

both lines of code work individually. The problem is that once I run
the first line of code, the second line ceases to function. Any ideas?
Thanks,

Mark

Jul 23 '05 #1
2 5081


Snolly wrote:

function reloadInfoPage( )
{
window.opener.p arent.document. write('Contents
Updated...reloa ding page');
window.opener.p arent.location =
window.opener.p arent.location;
}


Try
var win = window.opener.p arent;
var oldHref = win.location.hr ef;
win.document.op en();
win.document.wr ite('Contents ...');
win.document.cl ose();
win.location.hr ef = oldHref;
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Thanks Martin, your solution works perfectly.

Jul 23 '05 #3

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

Similar topics

3
6020
by: Sam | last post by:
I am constructing a company intranet. On the intranet I made an overview-page which displays the availability of equipment. The information comes out of a database, and is retrieved by php-script. The users of the database should be able to change the status of the equipment. On the overview-page, I placed a button next to each piece of...
4
3818
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following beautiful script "http://javascript.internet.com/navigation/toolbar-menu.html". It works like a charm. I made my webpage in frames, where the...
1
16004
by: fogwolf | last post by:
First a basic outline of what I am trying to do: I want to have a page spawn a pop-up when you click "submit" on its form. On this pop-up page there will be another form. When you click "submit" on the pop-up's form I want the pop-up to close & a new page to load in the "parent" window/page. I have this working in IE but cannot get it to...
3
1679
by: Tyrone Slothrop | last post by:
The first question, is this even possible? What I need to do is pass the contents of a PHP web page from a textarea using window.open method to a new browser window and display it. The page has a combination of HTML and PHP. The problem is that the PHP is not being interpreted. This is generally resolved by using the PHP eval() function....
4
2510
by: Keith | last post by:
I have this simple scenario. -------- Choose an item ->dropdownlist-> or <a>Create a new item</a> -------- When someone decides to click on the create a new item link, it takes them to a page in which they can enter more records to the database field to which the dropdownlist is bound.
4
5116
by: tcole6 | last post by:
My problem appears to be Firefox specific. I have a hyperlink that loads a new window. This window contains hyperlinks that call javascript functions in the parent window and then closes the child window. The function that is called contains an XMLHttpRequest. My problem is that everything happens as it should, the innerHTML is changed...
0
1188
by: K B | last post by:
Hi, I could be approaching this all wrong...so please let me know what you think. I have a 2 page frame (WIleft.aspx and WIright.aspx) in asp.net 2.0. I create an html page by transforming xml with xsl file into WIright and there are buttons created with dynamic parameters to pass when the function is run. I have the following script that...
2
2073
by: gsuns82 | last post by:
hi all, I got to reload parent window from its child window,i used the folloeing code opener.location.reload(); self.close(); in child window. Parent window gets reloaded its fine, but browser shows POST DATA alert before the parent window gets reloading. can any one give a solution for tis crisis,pls reply...
0
7435
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...
0
7698
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. ...
0
7794
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5361
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5080
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...
0
3472
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1922
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
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
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...

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.