Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>UPDATED:</p> <p>Have one method on an interval that sets up the 'session'/local-storage</p> <pre><code>var refreshing = false; var intervalID; $(document).ready(function(e){ var delay = 1234; intervalID = window.setInterval(setupInterval, delay); }); function setupInterval(){ refreshing = true; $.ajax(URL).done(function(r) { //do stuff setupStorage(r); refreshing = false; }); } function setupStorage(info){ //setup whatever here } </code></pre> <p>OLD:</p> <p>Could you use some logic in your ready function to gate what you need to do?</p> <p>So basically call one ajax call -> if false, just schedule your latter methods, otherwise run the setup one and on completion schedule the latter method. </p> <p>Some pseudo-code:</p> <pre><code>var refresh = false; $(document).ready(function(e){ $.ajax(URL).done( function(r) { if(r) { routeOne(); } else { latter(); } }); }); function routeOne(){ $.ajax(URL).done(function(r) { //do stuff latter(); }); } function latter(){ //All other ajax calls } </code></pre> <p>I'll put some more thought into this let me finish my coffee first...</p> <p>EDIT:</p> <p>Based on your updated description could it be possible for you to schedule a setInterval to run the checking method/hash update on the time interval that you need, and is the time interval on your server static or variable? Facebook does this with a heartbeat, I've used this type of logic with some 'locking' functionality in a web-app. If you schedule the interval properly it should not interrupt any other ajax calls.</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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