IMG_20200908_114948.jpg

Blog

Loading custom scripts in Squarespace

Squarespace is awesome, but its documentation is not. If you've got Developer Tools turned on in Squarespace, you can upload custom scripts into your /scripts directory and them import them via code injection.

Currently, the Squarespace docs give an example of using the Squarespace Script Loader:

<squarespace:script src="plugin.js" combo="true" />

...but I had no luck - my libraries weren't loading.

After more searching I found an old page for SS5 which shows a typical script load:

<script src="/scripts/plugin.js"></script>

Voila! It worked! 

Who knows why the SS loader isn't/wasn't working - we shouldn't be spending time on loading the scripts, we should be spending time on writing them.