|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
The main browser window is window X. A link opens up pop-up window Y.
Pop-up window Y displays page 1. Upon submission of page 1, user goes to page 2 still within window Y. What's the Javascript code I can use in page 2 (perhaps in onLoad in the <body> tag?!> when it loads up to automatically refresh window X? |
|
#2
|
|||
|
|||
|
I would research window.opener and the reload() function.
The answer is there. sorry about to walk out the door and don't have time to give an example. |
|
#3
|
|||
|
|||
|
Thanks for the tip Brian. Unfortunately though, I've looked at Javascript and it'll take quite a while for someone with my level of understanding of web languages to get to grips with it - I'd have to start from scratch (!) I won't have time, or need, to go into it in depth till the Summer.
I'd appreciate it if anyone else could point me to an appropriate code example - I've searched Google, About etc. with no luck. Any suggestions would be much welcomed. |
|
#4
|
|||
|
|||
|
Hello !!!
To automatically refresh window X u need the following lines in the onLoad of the opened window. <script language="JavaScript"> function refreshnow() { self.opener.location.reload(); } </script> <body onLoad="javascript:refreshnow()"> <form> <input type="button" value="this is new one"> </form> </body> Hope this helps u. :-) Pallavi. |
|
#5
|
|||
|
|||
|
Thanks for your post. I did in fact manage to solve the problem by asking in #javascript on DALnet IRC. The following was suggested and indeed worked on Netscape:
<body bgcolor="#FFFFFF" onload="opener.location.reload();"> BUT not in IE. The reason is that IE has stricter security; the pages that loaded up in window Y were on another domain. IE wouldn't let those pages affect (ie. refresh) the page in window X which was on a different domain. I basically worked around this by creating a global link on the server, so that I could create a link from domain1.com to the appropriate directory which served up the pages in window Y as "dirblah/page2.htm" as opposed to "http://www.domain2.com/dirblah/page2.htm Note: This was possible because the contents of both domains were in two separate subdirectories in the same root directory. I did this by entering the following on the command line, once I was in the directory for domain1.com: ln -s /home/username/public_html/domain2/dirblah dirblah I then changed my link in window Y from 'http://www.domain2.com/dirblah/page2.htm' to 'dirblah/page2.htm ... because having created the global link, domain1.com thinks that 'dirblah' is one of its own subdirectories - even though it is not really! Sounds confusing maybe to the casual browser of these boards, but if you have this problem this work around will save you hours of time! Maybe there's an even simpler soltution ... [This message has been edited by londonner (edited December 29, 2000).] |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Pop window refreshing parent window |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|