$.getJSON
attempt to get JSON from my webhost, seriema.net
HTML
<div class='wrapper'>
<p>JSON will be received in 1 second</p>
<ul id='post'></ul>
</div>
CSS
body {
font-family: Helvetica, Sans, Arial;
}
p, ul {
padding: 10px;
}
ul {
margin: 5px;
border: 2px dashed #999;
}
JavaScript
$.getJSON('', function(data) {
show_response(data, $('#post'));
});
show_response = function(obj, result) {
$.each(obj, function(k, v) {
result.append('<li>' + k + ': ' + v + '</li>');
});
};