Note that there are some explanatory texts on larger screens.

plurals
  1. POQueue AJAX calls
    primarykey
    data
    text
    <p>Hello I am doing a Horizontal scrolling website like: <a href="http://vanityclaire.com/" rel="noreferrer">http://vanityclaire.com/</a></p> <p>However, rather than having one large HTML file, after the load of the homepage, I am ajaxing in the children of home, using jQuery .load(). </p> <p>At present I for-each div and ajax in ithe url that sits in the title. But the AJAX returns out of order, and as I add more pages don't fancy <em>spanging</em> the server with 30+ http:// requests.</p> <p>How do I synchronously do the AJAX calls, i.e. wait for the first to comeback before a request another, or even send two at a time.</p> <p>I have been scouring, and cannot figure out what I need.</p> <p>This is my HTML:</p> <pre><code>&lt;div id="mainLayout" class="fullwidth scrollArea"&gt; &lt;div class="scrollItems"&gt; &lt;div id="page-1" class="scrollItem" title="/"&gt; &lt;div&gt;HOME PAGE CONTENT&lt;/div&gt; &lt;/div&gt; &lt;div id="page-2" class="scrollItem" title="/Page2.html"&gt; &lt;div class="loading"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="page-3" class="scrollItem" title="/Page3.html"&gt; &lt;div class="loading"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="page-4" class="scrollItem" title="/Page4.html"&gt; &lt;div class="loading"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="page-5" class="scrollItem" title="/Page5.html"&gt; &lt;div class="loading"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And my JS:</p> <pre><code>function s_loadingInitialPages() { var loadingItems = new Array(); $(".scrollArea .scrollItem").each(function () { if ($(this).attr('title') != '/') { var oDelem = $(this); loadingItems.push(oDelem); //alert('test'); } }); for (i = 0; i &lt; loadingItems.length; i++) { // title attribute is the URL to get var ajaxURL = loadingItems[i].attr("title") + '?ajaxPageContent='; $(loadingItems[i]).load(ajaxURL); } } </code></pre> <p>Is there a plugin I can just keep adding functions to a queue, and let that handle it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    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