Passing a variable to a new window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Adrian  MacNair

    #1

    Passing a variable to a new window

    Let's say I have thumbnail 1 and thumbnail 2.

    If I click on thumbnail 2 I want it to load a webpage which shows the larger
    image of image 2. If I click on thumbnail 1 I want to load the same webpage
    but swap the image to image 1. Any ideas?

    The problem:

    <a href="#"
    onClick="window .open('bigger.h tml',null,'heig ht=760,width=70 0,status=yes,to o
    lbar=no,menubar =no,location=no ')">
    <img src="images/thumb2.jpg" width="72" height="96" alt=""
    border="0"></img></a>

    The default image in bigger.html is image 1. Onload I would like it to be
    image 2 if the thumbnail is clicked. Does this make sense?


  • Adrian  MacNair

    #2
    Re: Passing a variable to a new window

    I *think* I figured it out:

    In main window:

    <a href="#"
    onClick="window .open('bigger.h tml?2',null,'he ight=760,width= 700,status=yes, t
    oolbar=no,menub ar=no,location= no')">
    <img src="images/thumb2.jpg" width="72" height="96" alt=""
    border="0"></img></a>

    In popup window:

    largeImage=Stri ng(location.sea rch);
    largeImage=larg eImage.substrin g(1);

    document.write( '<img id="gallimg" src="images/large'+largeIma ge+'.jpg"
    border="0">');


    Comment

    Working...