Ajax not working if called inside an ajax loaded template?
<p>I'm using ajax to change the value of an object (status), when the ajax is called, the object is changed but the page is reloaded.
here's my template:</p>

<pre><code>    &lt;table id="datatable" class="tabela"&gt;
        &lt;thead&gt;
            &lt;tr&gt;
                &lt;th&gt;RA&lt;/th&gt;                   
                &lt;th&gt;Ações&lt;/th&gt;                 
            &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
            &lt;g:each var="aluno" in="${listaAluno}"&gt;
                &lt;tr&gt;
                    &lt;td&gt;${aluno.ra}&lt;/td&gt;
                    &lt;td&gt;
                        &lt;g:link action="editar" controller="aluno" params="[id:aluno.id]"&gt; &lt;i class="fa fa-pencil button edit"&gt;&lt;/i&gt;&lt;/g:link&gt;&amp;nbsp&amp;nbsp&amp;nbsp                        
                        &lt;g:link onClick="inativar('/aluno/inativar/${aluno.id}', 'divForm', '${aluno.nome}')"&gt; &lt;i class="fa fa-trash button delete"&gt;&lt;/i&gt;&lt;/g:link&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            &lt;/g:each&gt;
        &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;script type="text/javascript"&gt;
        $(document).ready(function () {
        $('#datatable').dataTable({colReorder: true});
        });
    &lt;/script&gt;
</code></pre>

<p>the ajax:</p>

<pre><code>function inativar(metodo, div, objeto) {
    var confirmar = confirm("Realmente deseja remover " + objeto + " ?");    
    if (confirmar) {            
        $.ajax({
            url: metodo,
            type: "GET",            
            dataType: 'text',
            success: function (data) {
                $("#" + div).html(data);
            }
        });
    }
}
</code></pre>

<p>and the method: </p>

<pre><code>def inativar(){ 
        Aluno aluno = Aluno.get(params.id)
        aluno.status = false
        aluno.save(flush: true)
        def listaAluno = Aluno.findAllByStatus(true)        
        render(template:"list", model:[listaAluno:listaAluno])
    }
</code></pre>

<p>what am I missing?</p>