I'm having issues with appending a json. It print's multiple undefineds and i'm unsure what the cause is.
My code:
$("button").click(function() {
$.getJSON("https://api.myjson.com/bins/503aj", function(obj) {
$.each(obj, function(key, test) {
$("ul").append("<div>" + test.CustomerRef + "</div>" + "<div>" + obj.CustomerName + "</div>" + "<div>" + test.DelAddress1 + "</div>");
});
});
});
Linked js fiddle showing the issue;
https://jsfiddle.net/7vshmzj7/
Why does it do it? and what are the possible workarounds?