[Javascript] Passing Objects from one window to another in Javascript
Pramod Jain, INDENT
pramod at indent.org
Fri Jul 5 13:18:35 CDT 2002
The previous message had a typo: Should have been window.open and not
open.window. I am correcting it in the message below.
The problem of passing object remains
pramod
-----Original Message-----
From: Pramod Jain, INDENT [mailto:pramod at indent.org]
Sent: Friday, July 05, 2002 1:28 PM
To: javascript at LaTech.edu
Subject: Passing Objects from one window to another in Javascript
I am trying to access an object and I have tried two options, both have not
worked. Would appreciate help
============================================
Option 1. I get "Permission Denied":
In caller window:
-------------
function Object1()
{
this.phr = "abc";
this.openWind = open.Wind;
function openWind() {
newwin = window.open("ab.htm","");
}
}
obj1 = new Object1();
<body>
<input type=button onClick="obj1.openWind()">
</body>
-------------
In the called window:
function init(){
{
alert(opener.obj1.phr);
}
<body onLoad="init()">
</body>
===========================================
Option 2: I get "object does not support this property or method
In Caller window:
function Object1()
{
this.phr = "abc";
this.openWind = open.Wind;
function openWind() {
window.showModalDialog("ab.htm", this);
}
}
obj1 = new Object1();
<body>
<input type=button onClick="obj1.openWind()">
</body>
-----------------
In the called window:
function init(){
{
alert(dialogArguments.obj1.phr);
}
<body onLoad="init()">
</body>
More information about the Javascript
mailing list