This question already has an answer here:
maybe getting a brain freeze there but i cannot get this to work. any help would be appreciated. thanks
var prlist = loadList(rootUrl + '?action=product&country_id=' + userSelCountry);
response from PHP : [{"id":"-1","text":"no results found"}]
I have tried the following with no success
console.log(prlist) // [Object { id="-1", text="no results found"}]
console.log(prlist.id);//undefined
console.log(prlist['id'] // undefined
I need to retrieve the id value.
thanks
prlist
is an array! Arrays don't haveid
properties. – Felix Kling Nov 7 '15 at 16:28Object
within the array – charlietfl Nov 7 '15 at 17:17