Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

popsovy

Member
  • Content Count

    5
  • Joined

  • Last visited

  1. Using this method to upload a Javascript file But then, when I try to reference it from the Squarespace site, I get a CORS error: 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. Am I doing something wrong here?
  2. 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.
  3. Turns out that the reason for scripts with type="module" not loading in a mobile browser is because by default mobile browsers do not send cookies for this kind of requests. The fix here is to add crossorigin="use-credentials" to the script tag, so your tag should look like this: <script src="path to the file" type="module" crossorigin="use-credentials"></script>
  4. I uploaded a simple javascript file to my Squarespace site using this option . The javascript file contains alert("Hello"); nothing else. If I reference the files from <script src="path to the file"></script> all loads on desktops and on mobile devices. If I reference this file as <script src="path to the file" type="module"></script> it loads in desktop browsers, but in all mobile browsers (tested on iPhones), the script doesn't load. I then created a simple HTML page that referenced this JS file with type="module" and uploaded both files to my ISP. The files served from my ISP loaded fine on mobile devices. This makes me think there is a restriction at Squarespace that only allows type="text/javascript". This is a big limitation because a lot of modern JavaScript frameworks rely on loading javascript based on the type="module" attribute. Could Squarespace change the restrictions placed on serving javascript files to allow type="module" to be served from mobile browser? Thanks.
  5. I am developer, new to Squarespace. Need to add functionality to an existing form -- some advanced validation, call an API. Was going to use jQuery (I know I can add it to Squarespace) but then ran into JavaScript provided by Squarespace that looked like that -- Y.use('squarespace-form-submit', 'node',.... What is that Y. ? Looks like a JavaScript framework. I was wondering what it is -- perhaps, I don't need to add jQuery and use the framework that comes with Squarespace. Thanks.
×
×
  • Create New...