Solved

Accessing Main Window

Posted on 1998-12-19
2
206 Views
Last Modified: 2010-04-09
I have a HTML page (let's call this main window Window A) that has an object embedded(using IE 3.022 and above) and a link that when clicked, will use javascript to open/create a small new window (let's call it Window B).

In Window B, there are also links that when clicked, will need to trigger some events of the object embedded in Window A. I used something like this in Window B :

<a href="javascript:????.myObject.myObjectFunc(1)">Do something</a>

So what should I put in ???? to access the function of the object in Window A?

Thanks for helping!
0
Comment
Question by:janeb
[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
 

Author Comment

by:janeb
ID: 1840854
Edited text of question
0
 
LVL 4

Accepted Solution

by:
rafistern earned 50 total points
ID: 1840855
The way to refer to the opening window in JS1.1+ is "opener". In IE3 you will have a problem with "opener" which is not defined in JS1.0

Therefore when you open the window write this

<a href="javascript:newWin=open("...","..","....");if(!newWin.opener)newWin.opener=window;">

Now when you refer back to the opening frame use:

<a href="javascript:opener.window.document.myObject.myObjectFunc(1)">Do something</a>

The syntax "opener.window.document" is in order that the opener will work in IE3 and should not bother IE4 even though "window" is superfluous there.

0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JQuery conflicts/syntax issue 4 30
Hide and Unhide Table 6 39
Trying to use &NBSP to line up 3 rows 12 37
Replace statements HTML with HTML IF 8 46
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

736 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