When I call an api
that returns a random quote in json
format (a title and content), I receive the json
just fine :
ajax({ url: 'quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1', type: 'json' },
function(data) {
console.log(( JSON.stringify( data ) ));
console.log(data.content);
console.log(( JSON.stringify( data ) ));
outputs :
[{
"ID":1562,
"title":"Michael Bierut",
"content":"Most of the mediocre design today comes from designers who are faithfully doing as they were taught in school: they worship at the altar of the visual.\n",
"link":"http:\/\/quotesondesign.com\/michael-bierut-3\/",
"custom_meta":{"Source":"article"}
}]
But console.log(data.content);
outputs : none.