[thelist] To Joshua Olson, or whoever can help me with this Javascript problem

Jeff jeff at lists.evolt.org
Fri Sep 29 20:24:24 CDT 2000


henry,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Henry Vaillant <henrygvaillant at hotmail.com>
:
: I tried that bit of code you gave me a few days back,
: but I can't seem to get it to work -- maybe I'm doing
: something wrong.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

the problem with the code supplied by josh had some obvious errors in it.
if you were familiar with the open() method of the window object, or had
read up on the acceptable parameters you would've recognized that yourself.
(not to sound harsh - not sure how else to tell how important researching
the problem is)

http://developer.netscape.com/docs/manuals/js/client/jsref/window.htm#120273
1

the reason it's not working is because the open() method of the window
object only takes 3 parameters, as you can see from the documentation at the
url above.  the additional parameters that were included in josh's example
are simply ignored by the browser.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: In any case, I was wondering if someone could send me
: the complete source code for the parent and child pages
: concerned,  with all the HTML and Javascript code in place
: (and not too complex -- I'm looking for something relatively
: simple).  Once I have the basic skeleton,  I think I can take
: it from there.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<script language="JavaScript" type="text/javascript">
  <!--
    var pictureWindow = null;

    function openWin(pic,title,winx,winy)
    {
      features = 'resizable,width=' + winy + ',height=' + winx;
      pictureWindow = window.open('', 'pictureWindow', features);
      if(pictureWindow.focus) pictureWindow.focus();
      pictureWindow.document.open();
      pictureWindow.document.write('all your html for the child window goes
here.');
      pictureWindow.document.close();
    }
  // -->
</script>

called like this:

openWin('images/bigpic.jpg','Big Picture',400,200);

good luck,

.jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:jeff at members.evolt.org





More information about the thelist mailing list