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

Home Posts Topics Members FAQ

Refreshing the parent page from the SECOND child

Hello,

I posted this on two forums, without too much help .. and I am kinda
stuck in this.
I need to refresh the parent page from the second child window which
is opened by the first child and the first child window closes after
opening the second child.

This is the second time I am typing the post, I lost all content
because the site complaine I was using the lesser than symbol.

Here is the code I wrote for this. the first child doesnt open the
second child in IE. however, in firefox, the first child does open the
second one but closes without even me writing code to close. Ofcourse,
it doesnt call the script on the parent page.

Parent :
--------------------------------------------------------------------------------

<a href="javascrip t:void(0);"NAME ="My Window Name" title=" My title
here
"onKlick=window .open("child.ht ml","Ratting"," width=550,heigh t=170,0,status= 0,");>
Click here to open the child window</a>

--------------------------------------------------------------------------------
child :

--------------------------------------------------------------------------------

<script language="JavaS cript">function goback()
{window.opener. location.reload ("google.com"); window.close(); }</script>
and then called the function with a button open another window<a
href="javascrip t:void(0);"NAME ="My Window Name1" title=" My title
here11
"onKlick=window .open("child2.h tml","Ratting", "width=150,heig ht=120,0,status =1");>Click
here to open the child window</a <input type="button" value="Close
this window" Onklick="goback ()">

--------------------------------------------------------------------------------
child1 (this is saved as child2.html on my system):

--------------------------------------------------------------------------------

<script language="JavaS cript">function goback()
{window.opener. location.reload ("google.com"); window.close(); }</script>
and then called the function with a button on parent <input
type="button" value="Close this window" OnKlick="goback ()">

--------------------------------------------------------------------------------
ofcourse the onklick is typo'd. Any help, appreciated
Jul 31 '08 #1
4 3989
On Jul 31, 6:17 am, Buddha <happybudd...@g mail.comwrote:
Hello,

I posted this on two forums, without too much help .. and I am kinda
stuck in this.
I need to refresh the parent page from the second child window which
is opened by the first child and the first child window closes after
opening the second child.

This is the second time I am typing the post, I lost all content
because the site complaine I was using the lesser than symbol.

Here is the code I wrote for this. the first child doesnt open the
second child in IE. however, in firefox, the first child does open the
second one but closes without even me writing code to close. Ofcourse,
it doesnt call the script on the parent page.

Parent :
--------------------------------------------------------------------------------

<a href="javascrip t:void(0);"NAME ="My Window Name" title=" My title
here
"onKlick=window .open("child.ht ml","Ratting"," width=550,heigh t=170,0,status= 0,");>
Click here to open the child window</a>

--------------------------------------------------------------------------------

child :

--------------------------------------------------------------------------------

<script language="JavaS cript">function goback()
{window.opener. location.reload ("google.com"); window.close(); }</script>
and then called the function with a button open another window<a
href="javascrip t:void(0);"NAME ="My Window Name1" title=" My title
here11
"onKlick=window .open("child2.h tml","Ratting", "width=150,heig ht=120,0,status =1");>Click
here to open the child window</a <input type="button" value="Close
this window" Onklick="goback ()">

--------------------------------------------------------------------------------

child1 (this is saved as child2.html on my system):

--------------------------------------------------------------------------------

<script language="JavaS cript">function goback()
{window.opener. location.reload ("google.com"); window.close(); }</script>
and then called the function with a button on parent <input
type="button" value="Close this window" OnKlick="goback ()">

--------------------------------------------------------------------------------

ofcourse the onklick is typo'd. Any help, appreciated
If you have [as I understand it) any number of intermediate windows
and you want to close the main parent window from any of the [great-
grand-]children all you have to do is to pass a window name to the new
window that you are opening...
Then in you child you access the main window by name
mainParentWindo w = window.open("", mainParentWindo wName);
mainParentWindo w.location="... ";
Jul 31 '08 #2
On Jul 31, 2:23 pm, GArlington wrote:
On Jul 31, 6:17 am, Buddha wrote:
<snip>
> <a href="javascrip t:void(0);
Navigating to a javascript pseudo-protocol HREF does strange things in
Widows IE at least up until version 6. These include (but are not
limited to) stopping the playing of GIF animation, stopping changing
the displayed image when assigning to the - src - properties of IMG
elements and stopping acting on META REFRESH elements. Pretty much, if
javascript pseudo-protocol HREFs are activated on these browsers
nothing is guaranteed to work from that point on.

<snip>
>"width=550,hei ght=170,0,statu s=*0,");>
^^^
There is nothing in the specified form for the third argument to the -
window.open - method that suggests that '0' would be a meaningful
value, and if the browser does not ignore it then it is likely to
cause problems.

<snip>
>ofcourse the onklick is typo'd.
Why?
Any help, appreciated

If you have [as I understand it) any number of intermediate
windows and you want to close the main parent window from
any of the [great- grand-]children all you have to do is
to pass a window name to the new window that you are opening...
With the exception of tacking the name onto a query string in the URL
for the new window, anywhere you can pass a name you can also pass an
object reference. Thus it might be better to pass the reference
instead as the use of that might avoid the possibility of the -
window.open - call re-opening a main window that had already been
closed by the user.
Then in you child you access the main window by name
mainParentWindo w = window.open("", mainParentWindo wName);
mainParentWindo w.location="... ";
Why not use whichever URL is assigned to - location - as the first
argument to - window.open - and not bother with the second javascript
statement?
Jul 31 '08 #3
SAM
Buddha a écrit :
Hello,

I posted this on two forums, without too much help .. and I am kinda
stuck in this.
I need to refresh the parent page from the second child window which
is opened by the first child and the first child window closes after
opening the second child.
in 2nd child (daughter which will close the mother) :

var mamy = opener.opener; // the grand mother
opener.close(); // kill 1st child (the mother)
mamy.document.b ody.innerHTML = 'hello'; // gran'ma says 'hello'


or if you prefer :

- in 1st child (the mother) :

daughter = window.open('2. htm','','width= 300');
daughter.grd_mo ther = this.opener; // tell to daughter where is gran'ma
self.close(); // mother's auto close

- in 2nd child (the daughter) :

grd_mother.docu ment.innerHTML = 'hello';
--
sm
Jul 31 '08 #4
Buddha wrote:
I posted this on two forums, without too much help .. and I am kinda
stuck in this.
I need to refresh the parent page from the second child window which
is opened by the first child and the first child window closes after
opening the second child.
[...]
This is the second time I am typing the post, I lost all content
because the site complaine I was using the lesser than symbol.
Do not use Google Groups for posting.
Here is the code I wrote for this. the first child doesnt open the
second child in IE. however, in firefox, the first child does open the
second one but closes without even me writing code to close. Ofcourse,
it doesnt call the script on the parent page.

Parent :
--------------------------------------------------------------------------------

<a href="javascrip t:void(0);"NAME ="My Window Name" title=" My title
^^
here
"onKlick=window .open("child.ht ml","Ratting"," width=550,heigh t=170,0,
^ ^ ^
status=0,");>
^^^
Click here to open the child window</a>
Eeek.

Make it Valid HTML first (yes, all of it; yes, you will have to learn
HTML for that), then deal with possibly remaining scripting issues.

<http://validator.w3.or g/>
<http://diveintomark.or g/archives/2003/05/05/why_we_wont_hel p_you>
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Jul 31 '08 #5

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

Similar topics

1
2011
by: Pikolo Mondo | last post by:
hello, i've got a child window which will refresh the parent window after it closes heres the catch, if i use window.open() it works fine, but when i use window.showModelessDialog, the child window keeps poping up.. any idea?
4
4259
by: Sileesh | last post by:
Hi I have a btn in Parent.aspx page . On server_click() of the Btn, i am opening a new window called the child.apsx window. Child window also have a Btn. On serverClick of this Btn, I perform some operation . Once the operation is done, i have to close the child window, and refresh the parent window automatically. I am able to close the child window automatically , But not able to refresh the parent window.
3
1515
by: Mark | last post by:
I have a link on Parent.html which brings up Child.html in a separate browser window. Child.html has a button with Javascript to close itself. Is there a way I can cause Parent.html to be refreshed/reloaded after Child.html is closed? I don't care if it can be done in HTML, Javascript or PHP, just so it can be done. Is there a way to do this? Mark
3
2774
by: Iain | last post by:
How do I get a form to automatically refresh once (not continually using a timer). The scenario I have uses a parent table and a child table. (thanks to mmcarthy for indicating better termenology than I was using) I have a main form that displays one page per parent record and all the related child records in a sub-form. I then have a second form from which I can select records to be added (appended) to the child records. When the second...
1
1741
by: hashya | last post by:
Hi, I am opening window(child) from current window(parent). Now I want to keep refreshing child window from parent window. How can I achieve this. e.g. var win = window.open('http://www.thescripts.com'); how to use "win" to keep refreshing thescript.com Thanks
1
2332
by: Richard | last post by:
Greetings. I am total newbie to Javascript so what is written below is probably a bunch of cobblers!! Any assistance in correcting my code much appreciated. I wish the popped up child to pass value from the select box to a text box on the parent form. Here are my pages (in part)
0
2069
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in a dialog box ended up opening up a new browser window with the aspx page, I read on a forum that I should use the iframe control and since I have to open a bunch of pages as diaogboxes, I created a general page(Container.aspx) which has an...
1
9415
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in a dialog box ended up opening up a new browser window with the aspx page, I read on a forum that I should use the iframe control and since I have to open a bunch of pages as diaogboxes, I created a general page(Container.aspx) which has an...
0
9795
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
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
10212
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6951
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
5623
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
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4421
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
3970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.