[Javascript] Passing Objects from one window to another in Javascript

Pramod Jain, INDENT pramod at indent.org
Fri Jul 5 12:27:53 CDT 2002


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 = open.window("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