jQuery event not working after load
<pre><code>$(document).ready(function(){

$(function() {
    $('a.ajaxload').click(function(e) {           
      var url = $(this).attr('href');
      $('#desktopcontainer').load(url); // load the html response into a DOM element
      e.preventDefault(); // stop the browser from following the link
    });
});

$(function() {
    $(".accordion .accordion-tabs .tab").each(function(){
        $(this).click(function(){
            if ($(this).hasClass('tab')){
            $(this).removeClass('tab');
            $(this).addClass('active');
          }else{
            $(this).removeClass('active');
                    $(this).addClass('tab');
          }

          $(this).next().slideToggle('slow');
                return false;
        });
    });
});
});
</code></pre>

<p>My tab works fine but after I click the "a.ajaxload" to add a content to the page, then my tab doesn't respond anymore.</p>

<p>Can anyone please tell me where the problem is?</p>

<p>SOLVED!!!</p>

<p>What I did was to add the function after my load ... look at the new code below and see the difference. I hope it helps someone.</p>

<pre><code>$(document).ready(function(){

initDashboard();

$(function() {
    $('a.ajaxload').click(function(e) {           
      var url = $(this).attr('href');
      $('#desktopcontainer').load(url); // load the html response into a DOM element
      e.preventDefault(); // stop the browser from following the link
      initDashboard();
    });
});

function initDashboard() {
    $(".accordion .accordion-tabs .tab").each(function(){
        $(this).click(function(){
            if ($(this).hasClass('tab')){
            $(this).removeClass('tab');
            $(this).addClass('active');
          }else{
            $(this).removeClass('active');
                    $(this).addClass('tab');
          }

          $(this).next().slideToggle('slow');
                return false;
        });
    });
}

});
</code></pre>
