0

I wrote a jquery plugin. I want to upload it to a github public repo so that developers can use is like so:

<script type="text/javascript" src="https://raw.githubusercontent.com/davidstutz/bootstrap-multiselect/master/dist/js/bootstrap-multiselect.js"></script>

So far no issue.

But, I want to support versions so developers can do this

I can tag the repo with tags but access to the version file is via the commit and not the tag so the link is very not friendly:

<script type="text/javascript" src="https://raw.githubusercontent.com/davidstutz/bootstrap-multiselect/5shadf2346asdjfhaskdjhf234/dist/js/bootstrap-multiselect.js"></script>

I'm open to other suggestions that don't include github.

WebQube
  • 8,510
  • 12
  • 51
  • 93
  • It's generally not recommended to use GitHub as a CDN for JavaScript files - there's some more in this answer here: http://stackoverflow.com/questions/5502540/should-github-be-used-as-a-cdn-for-javascript-libraries). There are other websites you can use specifically for this purpose though :) – d0ug7a5 Jun 29 '15 at 12:46
  • thanks @d0ug7a5 , can you link up some of those websites? – WebQube Jun 29 '15 at 12:57
  • Hi @WebQube; I'd suggest trying out CloudFlare's free CDN (https://www.cloudflare.com/features-cdn) - they offer paid versions too, but the free version is perfectly robust. Amazon and Google also offer CDNs. – d0ug7a5 Jun 29 '15 at 12:59
  • I'm guessing loading files there is easy and you can set the link by version number like cdn.cloud.com/v1/myjs.js and cdn.cloud.com/v2/myjs.js. Thanks i'll give them a try. – WebQube Jun 29 '15 at 13:02
  • found the perfect answer here: http://stackoverflow.com/questions/17341122/link-and-execute-external-javascript-file-hosted-on-github . any moderators can comment how to post the answer here? – WebQube Jul 06 '15 at 14:44
  • Does this answer your question? [Link and execute external JavaScript file hosted on GitHub](https://stackoverflow.com/questions/17341122/link-and-execute-external-javascript-file-hosted-on-github) – Goran Stoyanov Dec 20 '19 at 19:09

0 Answers0