
Can't seem to create an object.
This is a restatement of the problem, after I got over a number of
misunderstandings about the scope and persistance of variables in
JScript/JavaScript, as well as the meaning of the parent property
(wrong! I needed caller -- I think --).
I'm trying to maintain a list of the names (in the sense of tragets) of
all extant windows, associated with the handles of the windows. The
reason is probably irrelivant, but if it would help I can expand this --
just SOMEBODY give me at least a hint.
Note that this is for an off-line presentation, coded in HTML and JS,
for (I had hoped) usablility on various platforms.
My current code is:
In the initial page:
<script><!--
self.window.name = "Main";
self.window.WindowList = {Main:self}
//-->
in a .js file which is loaded by all other pages, including various
pop-ups:
var BitsAcross = screen.width - 20;
var BitsDown = screen.height - 60;
if (self.window.opener !== null)
{self.window.WindowList = opener.window.WindowList}
function showimage(filename, windowname, x, y)
{var Scroll = 0;
if (x > BitsAcross)
{var Scroll = 1;
x = BitsAcross};
if (y > BitsDown)
{var Scroll = 1;
y = BitsDown};
var options =
"toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,scrollbars="
+ Scroll + ",width=" + x + ",height=" + y +
"screenX=0,screenY=0,left=0,top=0";
var n = navigator.appName;
if (n == "Netscape")
{self.window.WindowList[windowname]=window.open(filename, windowname,
options)}
else {var WindowToUse = self.window.WindowList[windowname];
if (typeof(WindowToUse) != 'undefined' && !WindowToUse.closed)
{WindowToUse.resizeTo(x, y)};
self.window.WindowList[windowname]=window.open(filename, windowname,
options)}
Quote:
}
I am currently debugging (trying to, at least) in Netscape, mainly
because I haven't found the I.E. equivalent to the Netscape de{*filter*}'s
inspector (can anyone point me to that?).
I have found that, even though the property WindowList gets initialized
in the home page that once I link (by a HTML link, not by the open
method) to another page it seems to vanish, eventhough it is still the
same window.
So, isn't there SOME place where I can hold onto a truly global value?
Cyril N. Alberga