Quote:
Originally Posted by Gemini23
Two questions:
1. Is there a way to get the javascript to load last (it is placed quite high up on the page - above the fold)
2. If the javascript doesn't load after a number of seconds.. say 10s - is it possible to load a message in its place - ie.. "Inventory updating please call back shortly"
Thanks for any advice...
|
1) Yes. Place the Javascript immediately before the </body> tag.
2) Yes. Provided you can identify the name of a
global Javascript variable in the downloaded script,
Code:
<script type = "text/javascript">
function testifloaded() {
if (typeof thirdpartglobalvariable == "undefined") {
alert ("Inventory updating please call back shortly");
}
}
window.setTimeout(testifloaded,10000); // 10 seconds
</script>
Naturally the above script must come after the third-party script. Instead of the primitive alert you might prefer to display a styled message in a <span>.
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.