Mario Campos Posted November 21, 2012 Share Posted November 21, 2012 I have a few JavaScript files that I need to upload (such as jQuery Waypoints - among others). Where do these get uploaded? Marketing, Communications, IT, Business Dev. and Web Design Link to comment
Mario Campos Posted November 30, 2012 Author Share Posted November 30, 2012 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 Marketing, Communications, IT, Business Dev. and Web Design Link to comment
VUELA Posted December 12, 2012 Share Posted December 12, 2012 this is a ridiculous workflow to simply upload files Link to comment
Mario Campos Posted December 12, 2012 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 comment
rsimko Posted August 30, 2013 Share Posted August 30, 2013 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? Link to comment
Guest Posted March 16, 2015 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 comment
colin.irwin Posted March 16, 2015 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 If you're looking for a Squarespace Developer, drop me a line. Link to comment
Guest Posted March 16, 2015 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 comment
thisisben Posted March 16, 2015 Share Posted March 16, 2015 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 Link to comment
Guest Posted March 17, 2015 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 comment
Guest Posted March 17, 2015 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 comment
UtopiaCreates Posted July 24, 2015 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 comment
yaip Posted March 1, 2016 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 comment
Philo Posted March 24, 2016 Share Posted March 24, 2016 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 Link to comment
Philo Posted March 24, 2016 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 comment
andreallevin Posted May 27, 2016 Share Posted May 27, 2016 thank you so much for this IT WORKED!!! You made my night! Link to comment
Intuitive By The Sea Posted July 18, 2016 Share Posted July 18, 2016 Yes! This was the problem for me - (an hour wasted). Thanks!! Link to comment
popsovy Posted September 13, 2019 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 comment
elderlyman Posted June 10, 2020 Share Posted June 10, 2020 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. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.