?
Solved

Test if parent window exist

Posted on 2003-02-20
2
Medium Priority
?
281 Views
Last Modified: 2008-02-01
Hi,

I have the following frames

-------------------
|     title       |
-------------------
|    |            |
|menu|  content   |
|    |            |
-------------------

and a popup window

---------
| popup |
|       |
---------

I use a JSP errorpage from content frame and popup window and i need to reload the menu frame in both case.

I try this : parent.menu.location.reload() but this give me an error from the popup window.

Can you help me please ?

0
Comment
Question by:boxsters
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
marc-pm earned 200 total points
ID: 7986547
Try this :
window.opener.parent.menu.location.reload()
or
window.opener.menu.location.reload()

(not sure if reference returned by window.opener is reference to the hole window or to the frame window that actually opened the pop-up window)

It ofcourse only works if you used window.open() method to show your pop-up window.
And check first if the element exists before you call its sub items/properties/methods to avoid errors :)
0
 

Author Comment

by:boxsters
ID: 7992137
Thanks a lot !

I try this code and it's what i need.

if (window.opener == null) {
     parent.menu.location.reload()
} else {
     window.opener.parent.menu.location.reload()
}
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question