Menu icon Foundation
Async JS and Foundation 5

Hi,

I was thinking of loading my javascript like this:

....
<script src="a/js/vendor/modernizr.min.js"></script>
<script async src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script async src=“foundation.min.js"></script>
<script async>$(document).foundation();</script>
</body>
</html>

Will this cause problems? Will the async scripts be guaranteed to execute in the correct order?

Alternately, what is the best way to load the foundation 5 javascript asynchronously?

Thanks,
Andrew

javascript

Hi,

I was thinking of loading my javascript like this:

....
<script src="a/js/vendor/modernizr.min.js"></script>
<script async src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script async src=“foundation.min.js"></script>
<script async>$(document).foundation();</script>
</body>
</html>

Will this cause problems? Will the async scripts be guaranteed to execute in the correct order?

Alternately, what is the best way to load the foundation 5 javascript asynchronously?

Thanks,
Andrew

This post has been closed. No new replies can be added.

Andrew Lahser over 5 years ago

In this other post, Karl Ward gives a great answer to my question:

http://foundation.zurb.com/forum/posts/10415-foundation-5-javascript-files-lets-finally-make-it-clear