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

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 in the console)

    
asked by anonymous 31.01.2014 / 00:08

1 answer

7

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

So the url made available is almost the same, you just need to remove the . (dot)

Before

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

Then

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

More info

Demo

    
31.01.2014 / 00:08