0

My JSON is good. I've followed a very simple example from the json2html site ... nothing displays.

<script type="text/javascript">
        
$.getJSON( "news/list/category/news/format/json",  function(data) { 

 

var transforms = {
 stories: [
    {'<>':'ul','class':'stories','html':function() {
        return($.json2html(this.groups,transforms.group));
    }}
 ],
 group: [
  {"<>": "li", "id":"id", "html":[
    {"<>": "span", "html": "${AUTHOR} ${HEADLINE}"}
    ]}
 ]
};
 
$('#stories').json2html(data, transforms.stories);

})

</script> 
  • `$.getJSON` would suggest you are using jQuery. Are you loading the library? What does your console tell you? – Turnip Mar 28 '17 at 11:53
  • I'm loading the library. No errors. If I console.log( data ); there is an object with columns filled with data. – howardowens Mar 28 '17 at 12:29
  • FWIW: using .getJSON with some javascript to output HTML with data works. Meaning something like this in a "test script" I set up works $.each( data, function( row ) { items.push( "
  • " + data[row].HEADLINE + data[row].AUTHOR + "
  • " ); – howardowens Mar 28 '17 at 12:32