How to stop/ignore AJAX request (server side)
<p>Please suggest me a best solution: </p>

<pre><code>&lt;script language='javascript'&gt;
    function fst(){
        $.ajax({url:"1.php", success:function(result){
        //do something
        }});
    }

    function scnd(){
        $.ajax({url:"2.php", success:function(result){
        //do something
        }});
    }
&lt;/script&gt;

&lt;input type='button' onclick="return fst()"&gt;
&lt;input type='button' onclick="return scnd()"&gt;
</code></pre>

<p><strong>1.php</strong>:</p>

<pre><code>&lt;?php 
    sleep(20);
?&gt;
</code></pre>

<p><strong>2.php</strong>:</p>

<pre><code>&lt;?php
    echo "hello";
?&gt;
</code></pre>

<p>Problem is that it waits 20 seconds before it executes second function after pressing first and second button. How do I make it completely ignore first function when second button is pressed?</p>
