title: How to make JavaScript work after AJAX?
body: <p>After reloading the page this code works as expected - javascript works and opens a popup. But when content of ajaxUpdatable is changed using AJAX, it doesn't work. How can I "rebind" or make something .live() for my eauth function here?</p>
  
  <pre><code>$("a.google").eauth({"popup":{"width":880,"height":520},"id":"google"});
  </code></pre>
  
  <p>Full page here.</p>
  
  <pre><code>&lt;div class="ajaxUpdatable"&gt;
     &lt;a class="direct auth-link google" href="/coverication/?
  r=site/login&amp;amp;service=google"&gt;Google&lt;/a&gt;
  &lt;a class="direct auth-link yandex" href="/coverication/?r=site/login&amp;amp;service=yandex"&gt;Яндекс
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  jQuery(function($) {
      var popup;
  
      $.fn.eauth = function(options) {
          options = $.extend({
              id: '',
              popup: {
                  width: 450,
                  height: 380
              }
          }, options);
  
          return this.each(function() {
              var el = $(this);
              el.live('click', function() {
                        if (popup !== undefined)
                            popup.close();
  
                        var url = this.href + (this.href.indexOf('?') &gt;= 0 ? '&amp;' : '?') + 'js';
                        /*var remember = $(this).parents('.auth-services').parent().find('.auth-services-rememberme');
                        if (remember.size() &gt; 0 &amp;&amp; remember.find('input').is(':checked')) 
                            url += '&amp;remember';*/
  
                        var centerWidth = ($(window).width() - options.popup.width) / 2;
                        var centerHeight = ($(window).height() - options.popup.height) / 2;
  
                        popup = window.open(url, "yii_eauth_popup", "width=" + options.popup.width + ",height=" + options.popup.height + ",left=" + centerWidth + ",top=" + centerHeight + ",resizable=yes,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=yes");
                        popup.focus();
  
                        return false;
                    });
          });
      };
  });
  
  $("a.google").eauth({"popup":{"width":880,"height":520},"id":"google"});
  $("a.yandex").eauth({"popup":{"width":900,"height":550},"id":"yandex"});
  &lt;/script&gt;
  </code></pre>