Jquery function works only one time
<p>here is a problem:</p>

<p>I need jquery to execute some php script and then return some results. There is a pagination at the page (generated by php). So there can be two cases. User gets to the page from external link => pagination starts from beginning. Or user selects a page => jquery runs php again and gets new pagination and results.
Here is a script:</p>

<pre><code>var page = '';
$.getJSON("test.php", {resid: "[[*id]]"}, function(output) {
    $('#testdiv').html(output.content).show();
    $('#pagination').html(output.pagination).show();
    $('a.pagenav').click(function() { 
        page = $(this).attr('href');
        $.getJSON("test.php", {resid: "[[*id]]", spp: page}, function(output) {
        $('#testdiv').html(output.content).show();
        $('#pagination').html(output.pagination).show();
        });
        return false;
    });
});
</code></pre>

<p>The script works at inilial load (pagination gets generated) and then one time I select a page. But the next time I select a page, it just follows it's url.
Need help )
thx</p>
