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

Cutter (javascript list) javascript at theblades-family.com
Mon Sep 30 08:03:09 CDT 2002


I did a similar implementation using ColdFusion. I named all of my images 
sm.[imagename].jpg and lg.[imagename].jpg, I passed [imagename] to my script 
for the links (<a href="javascript:void()" 
onclick="window.open('picdisp.html','[imagename]','[attributes]')"><img 
src="sm.[imagename].jpg"></a>). In my picdisp.html I wrote: 

<body 
onLoad="self.resizeTo(document.imgItemPic.width,document.imgItemPic.height+2 
5)" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
<script>
document.write("<img src='images/lg." + window.name + ".jpg' border='0' 
name='imgItemPic'>");
</script> 


Cutter 

Jefferis Peterson writes: 

> 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