title: delegate not working on Ajax loaded content
body: <p>I have a situation where the anchor tag with the class <code>confirm_booking</code> is generated by Ajax. So I used <code>delegate</code>. </p>
  
  <p>The div containing this anchor is now also generated by Ajax.<br>
  After loading the div via Ajax this function fails. </p>
  
  <pre><code>$('.restro_book_div').delegate('a.confirm_booking', 'click', function (event) {
      event.preventDefault();
      $('ul.time a').removeClass('clicked_confirmed');
      $(this).addClass('clicked_confirmed');
      var $current = $(this);
      var $reserve_restaurant_id = $current.attr('reserve_restaurant_id');
      var $reserve_time = $current.attr('reserve_time');
      var $table_type_id = $current.attr('table_type_id');
      var $reserve_date = $current.attr('reserve_date');
      var $reserve_slot = $current.attr('reserve_slot');
      var $reserve_discount = $current.attr('reserve_discount');
      var $reserve_loyalty_points = $current.attr('reserve_loyalty_points');
      var $reserve_table_type = $current.attr('reserve_table_type');
      //          alert(document.getElementById('standard-dropdown').value);
      //          console.log($current);
      //          console.log($reserve_loyalty_points);
      var $jquery_time = $current.attr('jquery_time');
      var $restro = $current.attr('restro');
      $target = $current;
      var popID = $target.attr('rel'); //Get Popup Name
      var popURL = $target.attr('href'); //Get Popup href to define size
      &lt;?
      php
      if (is_user_logged_in()) { ?&gt;
  
          $('#' + popID + ' .popup_heading').html('&lt;span&gt;THIS BOOKING IS VALID FOR&lt;/span&gt; ' + $reserve_table_type + ' &lt;span&gt;PEOPLE AT&lt;/span&gt; ' + $restro + '&lt;br/&gt; &lt;span&gt;ON&lt;/span&gt; ' + $reserve_date + ' &lt;span&gt;AT&lt;/span&gt; ' + $jquery_time); &lt;? php
      } ?&gt;
  
      //Pull Query &amp; Variables from href URL
      var query = popURL.split('?');
      var dim = query[1].split('&amp;');
      var popWidth = dim[0].split('=')[1]; //Gets the first query string value
  
      //Fade in the Popup and add close button
      $('#' + popID).fadeIn().css({
          'width': Number(popWidth)
      }).prepend('&lt;a style = "display:inline;" href="#" class="close"&gt;&lt;img src="&lt;?php echo DIVATEMPLATEPATH."/".IMAGEPATH ?&gt;/close.png" class="btn_close" title="Close Window" alt="Close" /&gt;&lt;/a&gt;');
  
      //Define margin for center alignment (vertical   horizontal) - we add 80px to the height/width to accomodate for the padding  and border width defined in the css
      var popMargTop = ($('#' + popID).height() + 80) / 2;
      var popMargLeft = ($('#' + popID).width() + 80) / 2;
  
      //Apply Margin to Popup
      $('#' + popID).css({
          'margin-top': -popMargTop,
              'margin-left': -popMargLeft
      });
  
      //Fade in Background
      $('body').append('&lt;div id="fade"&gt;&lt;/div&gt;'); //Add the fade layer to bottom of the body tag.
      $('#fade').css({
          'filter': 'alpha(opacity=80)'
      }).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies 
  
      return false;
  });
  </code></pre>