Solved

Accessing Main Window

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now