How to use github live code for development, testing and demos?

Asked

Viewed 162 times

5

How can I use Github code in real time in a demo or in development?
When I try to use code in jsFiddle or jsBin I get the error:

Refused to execute script from https://raw.github.com/utilizador/repositorio/ficheiro.js because its MIME type ('text/Plain') is not Executable, and Strict MIME type checking is enabled.

Example: jsFiddle (see error on console)

1 answer

7


The solution is to use a Github service that provides files with the header content type correct.

So the url provided is almost the same, just need to remove the . (dot)

Before

https://raw.github.com/utilizador/repositorio/ficheiro.js
           ^

Afterward

https://rawgithub.com/utilizador/repositorio/ficheiro.js
// ou mais recente:
https://rawgit.com/utilizador/repositorio/ficheiro.js

More info (in English)


Demo

Browser other questions tagged

You are not signed in. Login or sign up in order to post.