Re: Passing paramters between windows

by "Hilma" <Hilma(at)hilma.freeserve.co.uk>

 Date:  Wed, 8 May 2002 06:24:03 +0100
 To:  "Savard,
Gregg" <GSavard(at)UMPD.UMD.EDU>,
<hwg-techniques(at)hwg.org>
 References:  umd
  todo: View Thread, Original
wow - thanks!

However, i now have it working, using a different approach -

My problem was the "photo-display" page was already defined, and the html
for it existed;
so all i needed to add into it were the image file name, and title. (oops,
and description, i missed that)

So in my "photo-display"  i need to add
==================================================================
  <SCRIPT type="text/javascript">

var mytext = location.search.substring(0);
   var i = mytext.indexOf("=");
   var j = mytext.indexOf(",");

   photoname = mytext.substring(i+1, j);
   phototitle = mytext.substring(j+1);

   document.write("<h1>" + unescape(phototitle) + "</h1>");
   document.write("<img src='images/" + photoname + ".jpg' />");
   </script>
==================================================================

And in my calling page,
==================================================================
<a href="JavaScript:openWindow('HHPhotoSingle.htm?Pic=DofE01,The Duke of
Edinburgh Team.','myNewWindow',600,1000)">
<img src="images/DofE01_tn.jpg" alt="D of E Team" class="tnVertCentre" />
==================================================================

I'm hoping i can remove the window dimensions from this call, and somehow
make the new window resizable - but that means studying the books and i got
onto something else :-)
(I see your code has got the resiazable paramater in there; but i'd like to
put this, and the height/width attributes, into my existing "photo-display"
page.   But this is somthing i'm reasonabley sure is in the books, so i
can't - or won't - ask it here, as i do try to get things going before
running for help.!

(Shame about anyone with javascript turned off - they don;t get the big
photos - maybe i'll have to incorporate a <noscript> into my call page so
they don;t get a full page - no,  <noscript> into the "photo-display" paeg
saying

<noscript>
"You need JavaScript to view the full siozed version of this photograph"
<noscript>

hmmm- I'll go and add that now!


Many thanks -

hilma
---x---

>
> Passing parameters to a new window is actually something I have been
looking
> to do for a while.  Your message and some of the responses focused my
> search.  I managed to find a tutorial and came up with the following
script
> that seems to work for me.
>
> See if this will do what you want to do.  Just cut, paste, substitute for
> the generic names, and change <. to <
> You can add your style sheet as needed.
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA