Connecting Tech Pros Worldwide Forums | Help | Site Map

Objects and popup-windows

JonQuark
Guest
 
Posts: n/a
#1: Jul 23 '05
Hi,

I'm developing a Javascript intranet app that consists of a number of
windows. I have a variable called TopWin that points to the original,
first window (found using the opener method). Some javascript files
that are used everywhere are included only by that window and the
methods are called using TopWin e.g. TopWin.DoQuery(). Everything seems
fine in Firefox.

In IE6 I have a problem. If I want to instantiate an object from Topwin
inside a popup, it won't let me e.g.:
var fred = new TopWin.TableScan();
works from frames of TopWin but in other windows IE says:
"Invalid procedure call or argument"

Do I have to include the Javascript files in every window or is there a
more elegant solution? (I see the question has been asked here before;
April 23 2000 but no-one replied).

Thanks in advance for any help

Jon


Ivo
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Objects and popup-windows


"JonQuark" wrote[color=blue]
>
> In IE6 I have a problem. If I want to instantiate an object from Topwin
> inside a popup, it won't let me e.g.:
> var fred = new TopWin.TableScan();
> works from frames of TopWin but in other windows IE says:
> "Invalid procedure call or argument"
>
> Do I have to include the Javascript files in every window or is there a
> more elegant solution?[/color]

Did you try:
TableScan=TopWin.TableScan;
var fred = new TableScan();

And what is wrong with including your script files in all pages? After they
've been downloaded, they are available straight from the cache.
hth
--
Ivo



JonQuark
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Objects and popup-windows


<Unable to instantiate new objects from another window in IE>[color=blue][color=green]
>> Do I have to include the Javascript files in every window or is[/color][/color]
there a[color=blue][color=green]
>> more elegant solution?[/color][/color]
<Ivo wrote:>[color=blue]
>Did you try:
> TableScan=TopWin.TableScan;
> var fred = new TableScan();[/color]

Yes I did, it creates the object without error but I get an error when
I access the member variables. I have admitted defeat (at least for
now) and included the javascript in every window. This is inelegant as
I'm using TopWin method for transferring data between windows, when I'm
using objects they javascript is included locally which is inconsistent
and prevents using objects for certain things.

Ah well, hopefully one day IE7 will make this more consistent or other
browsers will make IE obselete....

Jon.

Closed Thread