0
votes

I have built an interactive Leaflet.js map that I have gotten working on my personal web hosting provider, but now I want to transfer it to Squarespace.

To keep things simple, I tried to externally reference the constituent scripts (e.g. <script src="url.com/java.js"></script>) but the Squarespace GUI says "Script Disabled".

Then I tried loading the script code itself within the <script></script> tags.

But this resulted in this error: You've reached the character limit for Code Blocks.

Have people successfully implemented Leaflet maps in Squarespace sites?

If so, how?

1

1 Answers

0
votes

If you are seeing a message regarding "script disabled", then you are likely viewing your website while logged-in and in the admin/config interface. When not logged in, the Squarespace platform itself doesn't block scripts with external source attributes.

Be sure you have another browser/window/tab open and preview it without being in the logged-in/admin/config experience when testing scripts within code blocks; the external script may work in that case.

As to the character limit of code blocks: As an alternative, use code injection, either site-wide or page-specific.