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

Jefferis Peterson jefferis at petersonsales.net
Fri Sep 27 15:43:22 CDT 2002


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




More information about the Javascript mailing list