Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2010
    Posts
    13
    Plugin Contributions
    0

    help question 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/...&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:

    PHP Code:
          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:

    PHP 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 .= '&amp;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):


    Code:
    <script language="javascript" type="text/javascript"><!--
    document.write('<a href="javascript:popupWindow(\'http://www.therovinghouse.com/store/index.php?main_page=popup_image&amp;pID=6\')">
    <img src="images/feelnopain-lavender.jpg" alt="Women\'s \&quot;Vegetables Feel No Pain\&quot; T-shirt" title=" Women\'s \&quot;Vegetables Feel No 
    
    Pain\&quot; T-shirt " width="108" height="120" /><br /><span class="imgLink">larger image</span></a>'); //--></script>
    doesn't work (attributes images):

    Code:
    <script language="javascript" type="text/javascript"><!-- 
    document.write('<a href="javascript:popupWindow(\'http://www.therovinghouse.com/store/index.php?main_page=popup_image&amp;pID=2\')">
    <img src="images/attributes/feelnopain-lavender.jpg" alt="" width="68" height="75" /></a>'); //--></script>
    Thanks in advance.

  2. #2
    Join Date
    Dec 2010
    Posts
    13
    Plugin Contributions
    0

    Default Re: Javascript popup window. What am I missing?

    Ugh, I got it, for whatever reason the javascript needed a line break to work.

    PHP Code:
          if (zen_not_null($grid_records['H']['options'][$grh]['image'])) 
              {
            
    $attrib_grid .= '<script language="javascript" type="text/javascript"><!--';

            
    $attrib_grid .= "\n";

                
    $attrib_grid .= 'document.write(\'<a 

    href="javascript:popupWindow(\\\'http://www.therovinghouse.com/store/index.php?main_page=popup_image&amp;pID='
    .$grh.'\\\')">';

            
    $attrib_grid .= zen_image(DIR_WS_IMAGES $grid_records['H']['options'][$grh]['image'], '''75%''75%');
            
    $attrib_grid .= '</a>\'); //--></script>';
          } 

  3. #3
    Join Date
    Dec 2010
    Posts
    13
    Plugin Contributions
    0

    Default Re: Javascript popup window. What am I missing?

    Another question: any hints as to how I can make these attribute images work with the popup link?

    http://www.therovinghouse.com/store/...&products_id=4

  4. #4
    Join Date
    Dec 2010
    Posts
    13
    Plugin Contributions
    0

    Default Re: Javascript popup window. What am I missing?

    bump. Only looking for help with the problem in the third post now. anyone?

 

 

Similar Threads

  1. v150 Popup Window
    By ladyk in forum General Questions
    Replies: 2
    Last Post: 27 Nov 2012, 07:26 PM
  2. Creating a javascript popup window?
    By stlnyc in forum General Questions
    Replies: 1
    Last Post: 18 May 2009, 01:54 PM
  3. javascript window
    By buildingblocks in forum General Questions
    Replies: 4
    Last Post: 20 Jul 2008, 02:03 PM
  4. What happen to the size of my Image Popup Window? It's tiny...
    By nicecarvings in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 19 Mar 2008, 04:34 PM
  5. Popup window
    By Parafanaylya in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 Jun 2006, 08:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg