Solved

Accessing Main Window

Posted on 1998-12-19
2
209 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

696 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