Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Accessing Main Window

Posted on 1998-12-19
2
Medium Priority
?
220 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 200 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

618 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