title: AJAX loader + SimpleCart
body: <p>after a bit of searching I was unable to find a helpful post so...</p>
  
  <p>My issue is that I use an ajax call to load some HTML into a lightbox:</p>
  
  <pre><code>function loadurl(str) {
  try {
  xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): newActiveXObject("Microsoft.XMLHTTP");
  }
  catch (e) {
  }
  xmlhttp.onreadystatechange = triggered;
  xmlhttp.open("GET","productpage.php?b="+str);
  xmlhttp.send();
  }
  
  
  //This is being triggered by
  &lt;a href="#lightcontent" title="$photoinfo" onClick="loadurl('$j')"&gt;Product Info&lt;/a&gt;
  </code></pre>
  
  <p>The HTML I'm using works when accessed directly and I'm able to add/remove things from the cart, but when it's loaded into the lightbox via the code above, none of the simpleCart functions work. Anyone have any advice?</p>
  
  <p>It seems like the eventListener in simpleCart.js isn't picking up events from the lightbox</p>
  
  <p>Thanks!</p>
  
  <p>EDIT:
  The  portion is from a PHP file, and the $j just sticks a number into loadurl().
  So, I'm loading (using 1 for example) productpage.php?b=1 into the #lightcontent div.</p>
  
  <pre><code>&lt;div class="simpleCart_shelfItem" id="simpleCart"&gt;
  &lt;img src="{$glr}1/$mainphoto/Info/name.jpg"id="prodInfo"&gt;
   &lt;img src="{$glr}ppimages/sizeqty.jpg" id="sizeqty"&gt;
   &lt;img src="{$glr}1/$mainphoto/Info/size.jpg" id="prodsize"&gt;
   &lt;img src="{$glr}ppimages/brandonmodelsize.jpg" id="modelsize"&gt;
      &lt;h2 class="item_name" style="display:none"&gt;$photoTitle&lt;/h2&gt;
      &lt;select name="size" class="itemSize"&gt;
      &lt;option value="medium"&gt;M&lt;/option&gt;
      &lt;option value="large"&gt;L&lt;/option&gt;
      &lt;option value="extralarge"&gt;XL&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type="text" value="1" class="item_quantity" /&gt;
  &lt;span class="item_price"&gt;35.99&lt;/span&gt;
  &lt;input type="button" class="item_add" value="add to cart" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is the code that is loaded into #lightcontent. SimpleCart is supposed to watch for any clicks to the class "item_add". When productpage.php is loaded via loadurl(), javascript doesn't work in the div :/</p>