Json data with this structure:
Title_day_hourminsec([
{"data":"x", "type":"y"},
{"data":"x", "type":"y"},
{"data":"x", "type":"y"},
{"data":"x", "type":"y"},
{"data":"x", "type":"y"},
{"data":"x", "type":"y"},
]);
from the call of jquery getJSON I'm not able to get the real content of the file, only got this is the html output:
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
this is the javascript snippet I've tried to get the json content:
<script type="text/javascript">
$(document).ready(function(){
$.getJSON("myremotedata",
function(data){
var items = [];
$.each(data, function(key, val) {
items.push('<li id="' + key + '">' + val + '</li>');
});
$('<ul/>', {
'class': 'my-new-list',
html: items.join('')
}).appendTo('body');
});
});
</script>
What am I missing?