Website Building » Squarespace » How Do I Upload a JavaScript File to Squarespace?

How Do I Upload a JavaScript File to Squarespace?

Last updated on December 13, 2022 @ 4:10 am

There are two ways to upload a JavaScript file to Squarespace. The first is through the Code Injection page, and the second is by using the Content Manager.

Code Injection

To upload a JavaScript file through Code Injection, follow these steps:

PRO TIP: The following warning is provided for your safety:

Please be aware that uploading a JavaScript file to Squarespace can potentially introduce malicious code into your website. This could allow attackers to gain control of your website, steal sensitive information, or even cause damage to your computer. Only upload JavaScript files from trusted sources, and be sure to scan them for malware before uploading.

  1. In the Home Menu, click Settings
  2. Click Advanced
  3. Click Code Injection
  4. In the Header box, add the following code:

<script src="YOUR-FILE-HERE.js"></script>

  1. Click Save

Content Manager

To upload a JavaScript file through the Content Manager:

  1. In the Home Menu, click Content Manager.
  2. Click Files.
  3. Upload your file.
  4. Once your file is uploaded, click it to open it.
  5. Copy the URL of your file.
  6. In the Home Menu, click Settings.
  7. Back in the Code Injection page, paste your URL into the Header box and add the following code around it:

<script src = “YOUR – FILE – HERE.js”></script>

Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.