Foundation 5: Unexpected end of script Foundation 5: Unexpected end of script wordpress wordpress

Foundation 5: Unexpected end of script


There is a good chance the errors you are seeing are caused by the way you're including the Foundation javascript file into your html file, and the place where you're then calling .foundation() to make use of it.

Ensure you include the js before any script which makes use of it.Ensure the version of jQuery you're using works with the version of Foundation js you're using.

Check other javascript which may have additional or missing brackets which are then messing with the parsing of the foundation script.


Since you are using Cloudfront, I assume you are using W3 Total Cache as well. Is that correct? I've seen issues like this when W3 Total Cache minifies your Javascript.

Before you rip your hair out digging through foundation.min.js, I recommend ruling out a few things. I would first recommend disabling Cloudfront in W3 Total Cache. This will rule out the possibility of Cloudfront not storing the latest js.

Second, I would recommend checking your js minify options in W3 Total Cache. Try disabling this as well, or adjusting the minify algorithm.