Do I need the 2 foundation.js links?

Do I need the top foundation.js link?
<script src="js/foundation.js"></script> <script> $(document).foundation(); </script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/js/foundation.min.js"></script>

So the first link is loading a local copy of the Foundation library. The third script is loading a CDN served version of the Foundation library. You only need to keep one of those, but whichever you choose it should be before the second script tag in you code block. Not sure of the version of Foundation your local copy, but you may need the second if you have used features that are only in Foundation 6.6.3 and the local version is significantly older.
Cheers,
Bob

1 Like

Is this right? I’m trying to tidy up.
</footer> <script src="js/vendor/jquery.js"></script> <script> $(document).foundation(); <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/js/foundation.min.js"></script> </script> <script type="text/javascript" src="https://use.fontawesome.com/releases/v5.13.1/js/all.js"></script> <script type="text/javascript" src="pgia/lib/pgia.js"></script> <script type="text/javascript" src="Simpleslideshow.js"></script> </body>

Not quite:

You have your second script tag split and you need to have the second script after the third. Basically the second script is triggering the Foundation library, so you have to load the library before you trigger it. So:

</footer> 
<script src="js/vendor/jquery.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/js/foundation.min.js"></script>
<script>$(document).foundation();</script>
<script type="text/javascript" src="https://use.fontawesome.com/releases/v5.13.1/js/all.js"></script>
<script type="text/javascript" src="pgia/lib/pgia.js"></script>
<script type="text/javascript" src="Simpleslideshow.js"></script>
</body>

Cheers,
Bob

1 Like

So the order is

  1. Call jquery
  2. Call foundation
  3. initialize foundation
  4. Call fonts
  5. Call js plugin
  6. Call js plugin

Order doesn’t matter for bottom plugins?

As long as they are after the jQuery call - if they use jQuery.

1 Like