By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

Objects and popup-windows

P: n/a
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

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ivo
"JonQuark" wrote

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?


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

Jul 23 '05 #2

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


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.

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.