Scripts don't work in ajax content
<p>My script to load dynamic content is this and works perfectly, the problem is that i cannot include scripts to the dynamic content. :</p>

<p>$('nav li a').click(function(){ </p>

<pre><code>    $(this).addClass("green");
    $('nav a').not(this).removeClass("green");  

    var toLoad = $(this).attr('href')+' #content';  
    $('#content').hide('fast',loadContent);  
    $('#load').remove();  
    $('#main').append('&lt;span id="load"&gt;LOADING...&lt;/span&gt;');  
    $('#load').fadeIn('normal');  
    window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);  
    function loadContent() {  
        $('#content').load(toLoad,'',showNewContent()); 

    }  
    function showNewContent() {  
        $('#content').show('slow',hideLoader()); 

    }  
    function hideLoader() {  
        $('#load').fadeOut('normal');  
    }  
    return false;  

   // this is the script that i want to trigger
   $('.lightbox').lightBox();

});
</code></pre>

<p>This way doesn't work, i also try the delegate mode like this:</p>

<pre><code>$('#content').delegate('img', 'click', light);

 var light = $('.lightbox').lightBox();
</code></pre>

<p>Can anyone help me please?</p>

<p>Thanks in advance.</p>
