My issue is that sometimes a piece of JavaScript (often Google Analytics) may take a very long time to load, although it's not important to the HTML be ready to be "traversed and manipulated". If I were to use the following code:
$(document).ready(function () {
$("p").text("The DOM is now loaded and can be manipulated.");
});
would this mean that the <p>
would not be populated till after something like Google Analytics is loaded?
Something like Google Analytics is generally not required on most websites and I have often found that I am waiting for it to load. (I don't want to use onload because of it's unreliability.)
Is there a better way or a way to say "don't wait for [...]"?
Note: I usually cannot put the code in a <script>
tag just before the </body>
tag because the site is based in a template. I usually can only edit the "content" of the page.