How to maintain JavaScript performance while making an Ajax request at mousemove event?
<pre><code>$( document ).bind( 'mousemove', function ( e )
{
    if ( e.pageY &gt; $( document ).height() - 400 )
    {
        $.ajax( {
            url: '/Tweet/GetFiveUserTweets',
            type: 'POST',
            async: false,  // preventing a lot of asynchronous requests            
            success: function ( result )
            {
                // result
            }
        } );
    }
} );
</code></pre>

<p>‘async:false’ hangs the browser until request completes and that’s not good.</p>

<p>and when remove '<code>async:false'</code>, dozen of simultaneous request made because <strong>mousemove</strong> event....</p>

<p>I don’t want to hang the browser. </p>

<p>I just want a single asynchronous Ajax request at a time.</p>

<p>Can anyone let me know how to do a better coding for this situation?</p>

<p>Edit:</p>

<p>Actually when user scroll down at bottom, I want to get five next records and append them at bottom. www.twitter.com do this with tweets....</p>

<p>what's about:</p>

<pre><code>$(window).bind('scroll', function () {
 if (nearBottomOfPage()) {
   // load things here ...
 }
});
</code></pre>

<p>I think it's better than mousemove...am I right?</p>
