country.json
.[
{
"name": "WORLD",
"population": 6916183000
You can actually use a locally created json
, in the jsfiddle documentation:
new Request.JSON({
url: '/echo/json/',
data: {
json: JSON.encode({
text: 'some text',
array: [1, 2, 'three'],
object: {
par1: 'another text',
par2: [3, 2, 'one'],
par3: {}
}
}),
delay: 3
},
onSuccess: function(response) {
show_response(response, $('post'));
}
}).send();
show_response = function(obj, result) {
$H(obj).each(function(v, k) {
new Element('li', {
text: k + ': ' + v
}).inject(result);
});
result.highlight();
};
It's not my code, it's their fiddle anyway ;) Here:
http://jsfiddle.net/zalun/QsHw4/light/
How do use your code with my code ?
Alright, you can actually use their code instead, since your goal is to use jsfiddle. Here's one with part of your json
:
http://jsfiddle.net/QsHw4/6348/
I turned the ul
into a table like this:
Country
Population
Lalaland
0
Here's the fiddle with Mr. Polywhirl CSS table ;P
http://jsfiddle.net/QsHw4/6351/