How to Upload a personal JS file to Dropbox / Cloud so that it can be used on a Page Level Script

Hi all!

I’m curious how you upload a JS file to dropbox and get the proper path / link to it so that you can use it in a script.

For example:

I have this mixitup pagination script purchased here MixItUp Pagination | KunkaLabs

I have downloaded the files
Downloaded dropbox
Uploaded the proper JS file into dropbox on my mac
right click, copy dropbox link

and it doesn’t work when I reference it in the script tag on my site. for the source file thing
It also doesn’t work if i edit the link and remove the stuff at the end so it just leaves it as the path /js file

Does anyone have any experience here doing this? Thanks!

read only link yo
https://preview.webflow.com/preview/clopicturesprototype?utm_medium=preview_link&utm_source=dashboard&utm_content=clopicturesprototype&preview=419f3d260b7c2f451b763f917b475503&mode=preview

It’s on the “work” page and the custom code is in the page settings.

The script im trying to load is the second one below the main mixitup js file source.

1 Like

Just save it as a text file (.txt extension) and upload to assets. Then include it like would any script where the source is the URI that you uploaded and the type=“text/javascript” and you will be all set.

3 Likes

Wondering if this worked for you @codyarsenault? Thanks for what seems like the obvious solution for this @webdev but I cannot seem to get things to work on my site. I’ve implemented the mixitup JS for filtering CMS content just fine but am having trouble doing so for the pagination. Any help or tips on this would be greatly appreciated. See preview link below:

https://preview.webflow.com/preview/dragonfly-uas?utm_medium=preview_link&utm_source=designer&utm_content=dragonfly-uas&preview=7e4633a180718253bd315b9dfa611b9b&pageId=6022d013c171ddc8cf8f7dc4&mode=preview

https://dragonfly-uas.webflow.io/operations/cinematography?9e780d24_page=2#pagination#pagination

Searchin for better ways to manage my js files. I use github to host my js files. But? webdev/Jeff S seems to be on to something!! Will try that. Thanks.

Jeff’s tip is a nice solution, if CORS is not important

Using github as a cdn is a bad idea though. Have a look at jsDelivr.com -
you can simply change the URL to your username and repo and it will cache it like a proper cdn wit correct header and stuff:
https://cdn.jsdelivr.net/gh/user/repo@version/file

1 Like