Re: pop-up window (again)

by "Donna M Smillie" <dms(at)zetnet.co.uk>

 Date:  Thu, 19 Aug 1999 22:26:26 +0100
 To:  "Mac Fenwick" <mfenwick(at)trentu.ca>,
<hwg-basics(at)hwg.org>
 References:  trentu
  todo: View Thread, Original
Interesting you should say that, since I've recently discovered my browser
(IE5) doing the same thing when I use the "window.open" javascript directly
in HREF for ordinary A links.  I've found that if you set the javscript up
as a function, in the HEAD of your document, and then call THAT in HREF, it
leaves the original window unchanged.  For example, in the HEAD of your
document, put something like this:

<script type="text/javascript" language="javascript"><!--
function opennewwindow (nwfile,nwname) {
    window.open(nwfile,nwname,'toolbar=no,etc');
}
//-->
</script>

Then for the link, use the following syntax:

<area href="javascript: opennewwindow('filename.html','windowname';">

[where 'filename.html' is the name of the file you want to open in the
popup window, and 'windowname' is the name you want to give the window -
note the single, rather than double, quote characters]

For whatever reason, this leaves the main window unchanged, where putting
the javascript directly in the HREF value brings up that "object" stuff.
Shrug!  :-)  It would probably be worth trying the same thing in your AREA
tags, and see if that solves the problem.

Regards,
Donna
--
dms(at)zetnet.co.uk
Different Worlds:  http://www.users.zetnet.co.uk/dms/
Pictures of the Past, The Leslie Smith Family,
An Introduction to HTML, Copyright Considerations
Calendar Wallpapers


----- Original Message -----
From: Mac Fenwick <mfenwick(at)trentu.ca>

> Thanks to everyone who has responded to my inquiry.
> I know have the window working at about %90 -- there's just one small
> problem.
> The smaller, new window opens and displays fine, with all the attributes
I
> want, but for some reason the original window (with my "index.htm" file)
> is going blank and displaying a message: "[object Window]"
> The code I use is as follows (abbreviated):
> <MAP>
> <AREA HREF="javascript:window.open()">
> </MAP>
> Can anyone tell me what is going on/where I've gone wrong?
> TIA
> Mac Fenwick

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA