I asked a question about including resources from GitHub and the answer was to use the raw link:
https://raw.github.com/username/repository/branch/file.js
I am trying to include a script using:
<script
type="text/javascript"
src="https://raw.github.com/username/repo/master/src/file.js"
></script>
but I get the following error:
Refused to execute script from 'https://raw.github.com/username/repo/master/src/file.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
Are there any alternatives to fix this error?
Usage example
I don't use this in the production but for a demo page:
project-repository-from-github
├─ master
│ ├─ src
│ │ └─ my-jQuery-plugin.js
│ └─ README.md
└─ gh-pages
├─ css
│ └─ style.css
└─ index.html
In the index.html page I want to have the latest build of my-jQuery-plugin.js. So, I would include the raw URL to the script.
How do I fix the error?