Okey, so I have been trying to figure this out all day and can't see the reason why this dosn't work.
I have a URL that creates this output:
[{"id":"1"},{"id":"2"},{"id":"3"},{"id":"4"},{"id":"5"},{"id":"6"},{"id":"7"},{"id":"8"},{"id":"9"},{"id":"10"},{"id":"11"},{"id":"12"},{"id":"13"},{"id":"14"}]
And in my JS file I have the simple code:
$.getJSON("path_to_url", function(data) {
console.log(data);
});
This gives my this output:
[Object { id="1"}, Object { id="2"}, Object { id="3"}, Object { id="4"}, Object { id="5"}, Object { id="6"}, Object { id="7"}, Object { id="8"}, Object { id="9"}, Object { id="10"}, Object { id="11"}, Object { id="12"}, Object { id="13"}, Object { id="14"}]
I have been trying all day to change my PHP file to generate this a better way and so on, and at the end I just made it this simple. But how should I "echo" this out from my JS file?
console.log(data.(?));
Thanks in advance, and if you do know of any good and easily understanding docs, please let me know :)