Note that there are some explanatory texts on larger screens.

plurals
  1. POPage becoming temporarily non responsive when making ajax requests
    primarykey
    data
    text
    <p>Scenrio: I have a web app where users can vote on things, and everything gets loaded with ajax when they progress to the next vote. The user can also click on a previous vote and the details of the vote get loaded into the page with ajax. The issue I'm having is that when the user clicks through previous votes the page eventually freezes momentarily. This happens around the 7/8th click. Upon the first few clicks all of the new information gets loaded into the dom super quick, and everything is all good. When the page does freeze it becomes unfrozen after 20-25 seconds. </p> <p>This is the js func that handles the clicks, and then I use a js.erb file to load the new information into the dom:</p> <pre><code>$('.vote.complete').click(function() { whence = "toCompleted"; vote_id = $(this).data('vote_id'); cid = $(this).data('campaign_id'); c_title = $('#outfitPair'+cid).data('campaign_title'); u_id = $('#outfitPair'+cid).data('other_id'); //_gaq = window._gaq; //if(_gaq != undefined){ // _gaq.push(['_trackEvent', 'ViewPreviousVote', c_title, u_id]); //} $('#outfitPair'+cid).find('.button.vote').removeClass('to-vote'); $(this).addClass('to-vote'); $.get('/campaigns/new_pair?whence='+whence+'&amp;vote_id='+vote_id) return false; }); </code></pre> <p>The js.erb file is quite a bit to look through. I more or less looking for suggestions of possible causes that I can investigate though, I don't expect any exact answers given this little informations.</p> <p>EDIT: I believe I've found a lead on the problem. It looks like each time you click on an old vote the # of ajax calls it makes grows by a factor of two, when it should only be making one.</p> <p><a href="http://i.imgur.com/QnvaaBD.png" rel="nofollow">http://i.imgur.com/QnvaaBD.png</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload