0

I have a js containing li items in my index.html file for android app, where the js is hosted on dropbox public folder - so my code in the top of html file is like:

<script type="text/javascript" src="https://dl.dropboxusercontent.com/u/aaa/test.js"></script>

This works well, to retrieve the contents within the file test.js, but now that dropbox is killing public folder concept, I was exploring alternatives and found github, and did exact same thing, where new URL for src is:

https://raw.githubusercontent.com/userss/test/master/test.js

But, this is not working! I am not sure what is the issue. Both the files contain the same text (as you may see).

Can anyone please guide me? Or suggest other free alternatives for what I am looking to accomplish?

Thanks

user3874356
  • 53
  • 1
  • 7
  • Possible duplicate of [Link and execute external JavaScript file hosted on GitHub](http://stackoverflow.com/questions/17341122/link-and-execute-external-javascript-file-hosted-on-github) – Peter Behr Mar 14 '17 at 09:08
  • Although cdn.rawgit does pull the content, the issue with that is, if I update content in my js then it won't be reflected in my app, which is why I used a public updatable structure to manage my content dynamically. – user3874356 Mar 14 '17 at 20:04
  • The solution here is to link to a specific commit/tag ref for the file (in production). You'll have to update that URL by hand as you make updates, but that could actually be helpful to keep versions tracked properly in production. A "development" link does update automatically (every few minutes or so) to reflect the most recent ref. What volume of requests are you making? Just Googling "free cdn" gives lots of options like https://www.cloudflare.com/plans/ or http://www.jsdelivr.com/ for light usage, it's up to you whether you do that or just host the file through your own webhost. – Peter Behr Mar 14 '17 at 22:49

0 Answers0