How do i timeout a jquery script thats set to run every second after half an hour?
<p>I have a jQuery script that runs a function every second with setinterval. But i want to set a timeout for that so after half an hour it kills the script. How do i do this? Thanks :)</p>

<p>source code:</p>

<pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;
$(function() {
    setInterval(oneSecondFunction, 1000);
});

function oneSecondFunction() {
    //var ID = $(this).attr("id");
    var ID = '1';
    if(ID){
        $("#more"+ID).html('&lt;img src="moreajax.gif" /&gt;');
        $.ajax({
            type: "POST",
            url: "ajax_more.php",
            data: "lastmsg="+ ID, 
            cache: false,
            success: function(html){
                $("ol#updates").prepend(html);
                $("#more"+ID).remove();
            }
        })
    }
    return false;
}
&lt;/script&gt;
&lt;style&gt;
</code></pre>
