country.json
.[
{
"name": "WORLD",
"population": 6916183000
If you put the JSON file in GitHub you may also Pass response directly from GitHub Repository.
Your JSON file must be named demo.response.json
and call it as below
/gh/get/response.json/{github_tree}/
For instance I have that JSON file here
https://github.com/chetabahana/chetabahana.github.io/blob/master/_data/demo.response.json
Then in JSFiddle you can get the data using Ajax as below:
HTML
Result will appear below with 1 sec delay
This text will be replaced
JS (Choose one of Mootools Framework)
window.addEvent('domready', function() {
new Request.HTML({
url: '/gh/get/response.json/chetabahana/chetabahana.github.io/tree/master/_data/',
data: {'delay': 1},
method: 'post',
update: 'demo',
onSuccess: function(response) {
$('demo').highlight();
}
}).send();
})
Note: There is no JSONP functionality provided. One may achieve it using raw GitHub URL.