This is probably a super easy question but I'm banging my head on it for some reason.
Here is the jQuery I have
$(function() {
$.get(urlGetContainerNumbers, function(data) {
console.log(data);
for (var idx = 0; idx < data.length; idx++) {
var containerNo = data[idx];
console.log(containerNo);
}
});
});
This is what is produced in firebug
I am expecting that when iterating through data I would get 1001, 1002, 1003, 1004, etc.
What am I overlooking? It seems as though the for loop isn't treating data as a json object, but rather a string literal...
Methinks you mean $.getJSON rather than $.get.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With