New Zenner
- Join Date:
- Dec 2010
- Posts:
- 13
- Plugin Contributions:
- 0
Javascript popup window. What am I missing?
I'm using 1.3.9, have successfully installed Stocks by Attributes and Product Attribute Grid. Here's a sample page:
http://www.therovinghouse.com/store/index.php?main_page=product_info&cPath=1&products_id=6
Trying to make the attribute images that normally show up at the bottom of the grid work like the main image, with a popup window. However, when I add my code, it simply makes the images disappear. I can't figure out what I'm missing.
Here's the original PHP code within attributes.php that displays the images correctly:
if (zen_not_null($grid_records['H']['options'][$grh]['image']))
{
$attrib_grid .= zen_image(DIR_WS_IMAGES . $grid_records['H']['options'][$grh]['image'], '', '75%', '75%');
}
Here's my code:
if (zen_not_null($grid_records['H']['options'][$grh]['image']))
{
$attrib_grid .= '<script language="javascript" type="text/javascript">';
$attrib_grid .= '<!-- document.write';
$attrib_grid .= '(\'<a href="javascript:popupWindow';
$attrib_grid .= '(\\\'http://www.therovinghouse.com/store/index.php?main_page=popup_image';
$attrib_grid .= '&pID='.$grh.'\\\')">';
$attrib_grid .= zen_image(DIR_WS_IMAGES . $grid_records['H']['options'][$grh]['image'], '', '75%', '75%');
$attrib_grid .= '</a>\'); //--></script>';
}
When I view the source of the finished page from the browser:
**
works (main image):**
<script language="javascript" type="text/javascript"><!--
document.write('<a href="javascript:popupWindow(\'http://www.therovinghouse.com/store/index.php?main_page=popup_image&pID=6\')">
<img src="images/feelnopain-lavender.jpg" alt="Women\'s \"Vegetables Feel No Pain\" T-shirt" title=" Women\'s \"Vegetables Feel No
Pain\" T-shirt " width="108" height="120" /><br /><span class="imgLink">larger image</span></a>'); //--></script>
doesn't work (attributes images):
<script language="javascript" type="text/javascript"><!--
document.write('<a href="javascript:popupWindow(\'http://www.therovinghouse.com/store/index.php?main_page=popup_image&pID=2\')">
<img src="images/attributes/feelnopain-lavender.jpg" alt="" width="68" height="75" /></a>'); //--></script>
Thanks in advance.