GitHub help file in jsFiddle

Is it possible to abuse grab files from github repo as external resources in jsFiddle?

+62
github jsfiddle
Mar 23 2018-12-23T00:
source share
4 answers

This is an updated answer, as the URL has changed a bit for Github ... I ran into this problem and understood it today. Hope this helps people find this post recently. Example for Bootstrap Slate theme from Bootswatch:

What is that !: D

+23
Jan 10 '14 at 16:15
source share

TL; DR; Visit rawgit.com , which will output your CDN files directly from GitHub so you can use them.

Unfortunately, none of the answers here worked for me. The rawgithub does not seem to work as the connection gets denied. So here is the complete solution that really worked. First, in GitHub, you need to click the Raw button to get the original JavaScript.

enter image description here

Then copy the url from the page you have too. You will notice that if you try to use this directly, you will get a warning from JSFiddle.

enter image description here

In particular, the browser will give you an error, for example:

Refused to execute script from https://raw.githubusercontent.com/nnnick/Chart.js/master/Chart.min.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

Take this url and visit rawgit.com . This will give you a https://rawgit.com/nnnick/Chart.js/master/Chart.min.js format URL, which you can then use.

I have tried and tested this and it seems to work fine without problems

+95
Jul 03 '14 at 8:09
source share

Another possibility is to add the Git library to the cdnJS Script repository (they write that any library that is very popular on GitHub will be accepted), and then use it as an external resource.

It just turned out: there are many Javascript libraries at http://jsdb.io/ , and it’s very easy to add new ones there - I’m just a matter of entering the URL of the Github repository.

+1
Sep 30 '13 at 16:18
source share

If the following folder structure has git repo

fiddletest / test1 (fiddletest is the name of the repo, and test1 is the folder)

then the corresponding jsfiddle link will be

 http://jsfiddle.net/gh/get/<library name>/<version>/<github user name>/fiddletest/tree/master/test1/ 

The folder and file structure should be as follows:

 fiddletest(the repo name) |____ test1 |____ demo.html |____ demo.js |____ demo.css |____ demo.details 

besides these three files, others will be ignored. The information file should contain information about the game and links to external resources (if any)

 --- name: test fiddle repo description: this is a test repo resources: - http://abc.xyz.com/abc.js - http://abc.xyz.com/abc2.js ... 

You may have noticed the link in the link too. If the script is with pure js, the library name should be "library" and the version should be "clean"

In a nutshell, the link for the github link should be in the following format

 http://jsfiddle.net/gh/get/<library name>/<version>/<github user name>/<repo name>/tree/<branchname>/<folder name>/ 
+1
Mar 18 '15 at 12:20
source share



All Articles