Pass response directly from GitHub Repository

While the demo might use Ajax requests jsFiddle will read them and send using the right MIME type.

Input

It is important to have demo responses prepared for jsFiddle.

Demo directory structure

  • DemoDirectory
    • demo.response.html
    • demo.response.json
    • demo.response.xml

Run in jsFiddle

URL: /gh/get/response.{extension}/{github_tree}/ where:

github_tree
the path to the directory used to display it on github page (without “http://github.com/”)
extension
the file extension of the demo.response.{extension} in github demo repository

Note

There is no JSONP functionality provided. One may achieve it using raw GitHub URL.

Example

Content of the http://github.com/zalun/jsFiddleGithubDemo/raw/master/Demo/demo.response.html will be returned with text/html MIME type if this url will be loaded http://jsfiddle.net/gh/get/response.html/zalun/jsFiddleGithubDemo/tree/master/Demo/ using Ajax request.

Here it is working within the jsFiddle

Table Of Contents

Previous topic

Display Fiddle from Gist

Next topic

Pass response directly from Gist

This Page