[Javascript] New window open with properties and loaded php variables

Nancy Burton-Vulovic nancybv at idirect.ca
Fri Sep 27 17:03:25 CDT 2002


Are you saying that your script in the body is working, in that the
thumbnail field is displaying? If it were me, I'd check a couple of things:

1. [pictures] is not [picture] or [Pictures] or something
2. I thought you needed quotes around whatever you were echoing. (I always
use them). But if it's working in the second example, I suppose you don't.
3. Aren't you calling things twice? I mean, you call the contents of
$row_viewall[pictures] in the window definition, and then you write it again
in the document.write. Perhaps comment out the newWindow.document.write
line, and see if it works.
4. If you are going to leave it in, you can't just get that variable, it's a
picture, yes? Don't you need to call it within an img src, or something?

Just my .02 as I'm very tired on a Friday evening

N





----- Original Message -----
From: "Jefferis Peterson" <jefferis at petersonsales.net>
To: "Javascript Mail" <javascript at LaTech.edu>
Sent: Friday, September 27, 2002 4:43 PM
Subject: [Javascript] New window open with properties and loaded php
variables


> I'm trying to do something with a combination of php and javascript:
>
> Click on an image that is created dynamically in a page from a database,
> open a larger version of the image in a small pop up window. The problem
is
> I'm not sure how to transfer the variable of the larger picture to the new
> window:
> In Header I have:
>
> > <script language="JavaScript" type="text/JavaScript">
> > function newWindow (){
> > newWindow = window.open('<?php echo $row_viewall['pictures'];
> > ?>','LargePicture', 'width=400, height=400,
> > scrollbars=no,resizable=yes,toolbar=no')
> > newWindow.document.write("<html><head><title>Large
View<\/title><\/head><body
> > bgcolor=black><div align =center><p><?php echo $row_viewall['pictures'];
> > ?></p></div><\/body><\/html>")
> > newWindow.document.close()
> >
> > }
> > </script>
> In Body:
> >  <a
> > href="javascript:newWindow()"><img src="<?php echo
$row_viewall['thumbnail'];
> > ?>" alt="<?php echo $row_viewall['item_name']; ?>"
border="0"></a></font>
> >       </div></td>
>
> But it's opening a blank black page. Can I put a php variable in the
> newWindow function?
> ~~~~~~~~~~~~
> Jefferis Peterson, Pres.
> Web Design and Marketing
> http://www.PetersonSales.net
> Tel . 724-458-7169
> ICQ 19112253
>
> http://www.Slippery-Rock.com - 7,000 hits per year
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>





More information about the Javascript mailing list