Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>--- Post-clarification Answer ---</p> <p><em>My original answer should be useful to someone (I hope), but it isn't a direct response to the question, so I'll post another answer</em></p> <p>The answer to your restated question is "no". In the case of FF, there is a predefined initial render delay, but other browsers will be different. That FF render delay can be tweaked as well.</p> <p>Using FF as an example, those initial 250ms are time for FF to find out at least <em>some</em> useful information before attempting the first render. It then does additional renders periodically as it learns more.</p> <p>There is no way for you to determine when the browser has started to render the HTML document.</p> <p>--- Original Answer ---</p> <p>To directly answer your question, I believe Firefox waits 250ms before acting on the first data received, but that can be changed. For other browsers, I don't know.</p> <p><strong>However, you don't want to go that route.</strong></p> <p>When jQuery is ready to work its magic, it'll let you know by firing <code>$(document).ready()</code>. Before then, any attempt to use jQuery will fail. In other words, your spinner isn't showing up because jQuery isn't ready to process that request yet.</p> <p>Consider the following example, where two placeholders are shown on-screen, and we'll use jQuery to hide them.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; // We're not ready yet. This will fail. $(".placeholder").hide(); $(document).ready(function(){ // This won't fail $("#one").hide(); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="one" class="placeholder"&gt;Placeholder One&lt;/div&gt; &lt;div id="two" class="placeholder"&gt;Placeholder Two&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>It may appear at first that <code>$("#one").hide();</code> is redundant, but that's not true. <code>$(".placeholder").hide();</code> is called before jQuery is ready, so it has no effect, which is why you'll see "Placeholder Two" displayed (and not "Placeholder One") if you run the markup above in a web browser.</p> <p>Now that we have that out of the way, the solution to the larger problem (the "right way") is AJAX.</p> <ol> <li>Load a base page that contains the spinner code. Make sure the code to load the spinner runs as part of <code>$(document).ready()</code>.</li> <li>Use <a href="http://api.jquery.com/category/ajax/" rel="nofollow noreferrer">jQuery's AJAX functionality</a> to get the report you want.</li> <li>When it comes back, hide the spinner, inject the report into your base page.</li> </ol> <p>Good luck!</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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