Mario Campos 440 Share Posted November 21, 2012 (edited) I have a few JavaScript files that I need to upload (such as jQuery Waypoints - among others). Where do these get uploaded? Edited August 31, 2013 by Mario Campos Simplify! sleeptomorrow, CedricLor, Scoobie and 10 others 14 Marketing, Communications, IT, Business Dev. and Web Design Link to post
15 Mario Campos 440 Author Solution Share Posted November 30, 2012 (edited) I contacted Squarespace Support and they provided a helpful answer, which I expanded open by organizing my scripts onto a single page: Add a new page called 'JavaScript Files' [optional] Go to Page Settings and Disable the page [optional] Add a Text Block Add some text, preferably the name of your JavaScript file, like Sample JavaScript Select the ‘Sample JavaScript’ text and make it into a Link Click Files on the Link menu Click in the white space and select the file from your hard drive (or drag it onto the space from your hard drive) - I’ll use javascriptfile.js for this example Click in the Text Block again, and click on the Link Text – Squarespace automatically displays the URL it points to when you click on it, which should be /s/javascriptfile.js [whatever the name of the file your uploaded is] You can right click and ‘Copy Link Address’ to make sure you have the correct URL Go to your Code Injection (either the Page’s Code Injection or your site-wide Page Injection) and insert the code: <script src="/s/javascriptfile.js"></script> Using the name of the file you just uploaded instead of javascriptfile.js of course. You can keep adding JavaScript files, and it appears Squarespace automatically adds them to a javascriptfile.js directory. No need to link scripts via Dropbox or include the entire script in the Code Injection. You can use this to upload any file as well, but most other things have a place (CSS files and image get uploaded in the CSS Upload File area, etc.). Source: Creating a Text Link Edited November 30, 2012 by Mario Campos Added Source from the relevant Squarespace help page Jesse_effective 1 Marketing, Communications, IT, Business Dev. and Web Design Link to post
9 VUELA 474 Share Posted December 12, 2012 this is a ridiculous workflow to simply upload files terryrayment, judy and marc444 3 Link to post
1 Mario Campos 440 Author Share Posted December 12, 2012 I don't disagree with you. Squarespace 6 is trying to streamline each file upload type to be more natural, but in the end you need a guidebook just to find out where to upload everything. Squarespace 5 was folder based which was not as 'cool' but definitely more usable. I consider this method a hack until Squarespace 6 gets updated with a more useful file upload system. I think they can have various 'upload points' but it should all be easy. Folders work well, and we use them for a reason. Marketing, Communications, IT, Business Dev. and Web Design Link to post
1 colin.irwin 17,548 Share Posted March 16, 2015 @CedricLor Do any of your uploaded files have more than one '.' in the filename? If so, there is a file renaming bug in Squarespace that strips out all but the last '.' eg. myscriptname.min.js gets uploaded to /s/myscriptnamemin.js Please hit LIKE to share your appreciation of posts that are helpful or useful. The like button is somewhere over there Of course, Likes don't pay the bills.. If you're looking for a Squarespace Developer you can hire me here Link to post
1 CedricLor 0 Share Posted March 17, 2015 @silvabokis Just had to wait one night and the files are now correctly referenced and accessible. Weird squarespace. Thanks for your help! Link to post
0 rsimko 179 Share Posted August 30, 2013 (edited) Not sure why, even though this makes perfect sense it didn't work for me. Copy and paste the js file content into code injection area works perfectly. Neither of these worked Upon looking at the source in Firebug when I expanded my There should be my script as far as I am concerned. Any ideas? Edited August 30, 2013 by rsimko Link to post
0 CedricLor 0 Share Posted March 16, 2015 Hi Rsimko Having the same issue as you, but more messie. Some of my files appear to have been uploaded and load on call. Other don't load, even they seem to have be uploaded. Very messy. Mario Campos, did you ever manage to have Waypoint up and running on Squarespace? I am desperately fighting but can't seem to find a way out. Thanks Link to post
0 CedricLor 0 Share Posted March 16, 2015 Hi @silvabokis, I noticed the bug, but this does not change anything. Half of my uploaded files are loaded and the other half appears to have been uploaded on their servers but does not load with the pages. From what I see, the files that are loaded are the no-framework Waypoints files while the JQuery Waypoints files do not load. They probably do not load because they cannot load the JQuery file, even this one is loaded... So feed up with Squarespace... Link to post
0 thisisben 0 Share Posted March 16, 2015 (edited) Anyone know if this will work on a product page in the product description? I need to inject JavaScript and be able to call that JavaScript from within a product description. Thanks Edited March 16, 2015 by thisisben Link to post
0 CedricLor 0 Share Posted March 17, 2015 @thisisben I see no reason why it shouldn't work. However, be careful of the bug mentionned by @silvabokis and give squarespace some time (one night in my case as mentionned in my earlier post) for the files to be correctly uploaded and, more important, loaded. Link to post
0 UtopiaCreates 2,826 Share Posted July 24, 2015 This works, I was having issues getting a muse parallax page with svg files working and for some reason uploading the styles and scripts via developer mode was not working so I tried this method and it actually works. So Happy. Link to post
0 yaip 0 Share Posted March 1, 2016 when i follow these steps, the file name is 's/fgojojouerpepw' (or something like that). However, when i try to reference it in my header by page-header-code-injection, like such, ', it doesn't find the file. What am I doing wrong? Link to post
0 Philo 0 Share Posted March 24, 2016 (edited) Just realized the sftp command line issue was I didn't include the site folder (as is mentioned in the page I referred to) So, setup... I used a ssh config file since I couldn't quickly figure out how to provide a username with an ampersand in it to sftp command line program. This example is good for GNU Linux, BSD etc will vary slightly for Windows. # ~/.ssh/config Host SQUARESPACE HostName dev.squarespace.com Port 2030 User your-user-name And then at the command line just run the following sftp command > sftp SQUARESPACE:/your-site-name Edited March 24, 2016 by Philo Link to post
0 Philo 0 Share Posted March 24, 2016 Didn't see it mentioned here, see details about Developer Mode on http://developers.squarespace.com/initial-setup/. Don't know when it was first made available so it may be a recent addition. In short, squarespace offers SFTP access to the template code for your site. It also provides a GIT repo of the template code, nice! Note: I successfully used FileZilla to establish the SFTP connection, using sftp at command line would connect but was then immediately disconnected... didn't bother investigating further to figure out what was going on. Link to post
0 andreallevin 14 Share Posted May 27, 2016 thank you so much for this IT WORKED!!! You made my night! Link to post
0 Intuitive By The Sea 34 Share Posted July 18, 2016 Yes! This was the problem for me - (an hour wasted). Thanks!! Link to post
0 popsovy 0 Share Posted September 13, 2019 Using this method, I am getting Access to script at 'https://static1.squarespace.com/static/57014b5b746fb963478e3d4f/t/5d7ba83d4e25b616833d896b/1568385085375/runtime-es2015.js' (redirected from 'https://brooke-meek.squarespace.com/s/runtime-es2015.js') from origin 'https://brooke-meek.squarespace.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Do you know how to resolve this error? Thank you. Link to post
0 elderlyman 1 Share Posted June 10, 2020 (edited) I am hoping that the @Mario Campos answer from November 30, 2012 is still valid. If it is valid, I would love to hear some input from @SQUARESPACE about whether users should still expect to wait 24 hours for uploaded files to be accessible/run when referenced on other pages, as observed by @CedricLor. My goal is to upload files to an unlinked and disabled page so that I can reference API keys securely rather than write those keys directly into a code block. Would disabling a page interfere with file references? Toggling it enabled/disabled does not seem to make a difference. Edited June 10, 2020 by elderlyman changeed "code injection" to "code block" Link to post
Question
Mario Campos 440
I have a few JavaScript files that I need to upload (such as jQuery Waypoints - among others).
Where do these get uploaded?
Edited by Mario CamposSimplify!
Marketing, Communications, IT, Business Dev. and Web Design
Link to post
Top Posters For This Question
4
3
2
1
Popular Days
Mar 16
4
Mar 17
2
Dec 12
2
Mar 24
2
Top Posters For This Question
CedricLor 4 posts
Mario Campos 3 posts
Philo 2 posts
Intuitive By The Sea 1 post
Popular Days
Mar 16 2015
4 posts
Mar 17 2015
2 posts
Dec 12 2012
2 posts
Mar 24 2016
2 posts
Popular Posts
VUELA
this is a ridiculous workflow to simply upload files
Mario Campos
I have a few JavaScript files that I need to upload (such as jQuery Waypoints - among others). Where do these get uploaded?
Mario Campos
I contacted Squarespace Support and they provided a helpful answer, which I expanded open by organizing my scripts onto a single page: Add a new page called 'JavaScript Files' [optional] Go to Page
18 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment