title: Fancybox not working on Ajax site after PHP call and DOM repopulates with HTML
body: <p>Im building a simple ajax website that loads <code>#pageContent</code> through a <code>php</code> call that populates the DOM with HTML. I'm using Fancybox for links within the <code>#pageContent</code>. Problem is on the home page the fancybox works fine when I go to another page though the fancybox doen't work anymore and the links do not work at all. I have moved scripts around tried <code>setTimeout</code>, <code>pageLoad()</code>, and many other ideas. Please someone help me Im going crazy about this:</p>
  
  <p>Here is the code:</p>
  
  <p>Ajax call:</p>
  
  <pre><code>var default_content="";
  
  $(document).ready(function(){
  
  checkURL();
  $('ul li a').click(function (e){
  
          checkURL(this.hash);
  
  });
  
  //filling in the default content
  default_content = $('#pageContent').html();
  
  
  setInterval("checkURL()",250);
  
  
  });
  var lasturl="";
  
  function checkURL(hash)
  {
  if(!hash) hash=window.location.hash;
  
  if(hash != lasturl)
  {
      lasturl=hash;
  
      // FIX - if we've used the history buttons to return to the homepage,
      // fill the pageContent with the default_content
  
      if(hash=="")
      $('#pageContent').html(default_content);
  
      else
      loadPage(hash);
  }
  }
  
  
  function loadPage(url)
  {
  url=url.replace('#page','');
  
  $('#loading').css('visibility','visible');
  
  $.ajax({
      type: "POST",
      url: "load_page.php",
      data: 'page='+url,
      dataType: "html",
      success: function(msg){
  
  
          if(parseInt(msg)!=0)
          {
              $('#pageContent').html(msg);
              $('#loading').css('visibility','hidden');
          }
      }
  
  });
  
  }
  </code></pre>
  
  <p>Fancybox script fire:</p>
  
  <pre><code>$(document).ready(function(){
      $(".extLink").fancybox({
           'width' : '75%',
           'height' : '100%',
           'autoScale' : false,
           'transitionIn' : 'elastic',
           'transitionOut' : 'fade',
           'type' : 'iframe'
       });
  
  });
  </code></pre>
  
  <p>links to the problem are as follows:</p>
  
  <p><a href="http://dev.abdemo.net/perfectparties" rel="nofollow">http://dev.abdemo.net/perfectparties</a></p>