What I thought was going to be a simple question has turned out to more difficult than expected. Without complicating matters, I have this JSON string that is being returned from the server. This is exactly what the string looks like. It is inside data.occupation
.
{"occupation": "Boxer", "id": 2},{"occupation": "Helper", "id": 3}
What I need is an array of ids: [2, 3]
I have tried to loop over this set and get type error, undefined.
Is it even possible to do this with JQuery, or should I be parsing this backend and sending JQuery an array of ids?