I'm not even sure if this is how you're supposed to do it, but this is what I have so far:
$.getJSON("/api/get_categories", function(data){
var items = [];
$.each(data["categories"], function(key, value){
items.push('<div class="card"><div class="card waves-effect waves-block waves-light"</div><div class="card-content"><span class="card-title activator grey-text text-darken-4">'+value+'</span></div></div>');
});
$("#categories").html(items.join(""));
});
The issue is that the string within my push looks really awkward and long. What's the better way of doing this?