Obtaining key, value from $.each - json OBJECT; NOT array
Below is returned from my firebug. From console.dir(pData); and
console.log("type ... "+typeof(pData))= 'object'; pData is returned from AJAX call to .PHP file.
I'm trying to use $.each to obtain key, value pairs from pData. Does pData have to be converted to an array first since this doesn't seem to work?
- $.each(pData, function(key, value) {
document.write(this.key+"..."+this.value+"<br />");
});
Gives me undefined 44 times. (length of pData).
Appreciate help in fixing this.
|
|
|
0
|
Object { id= "178" , player= "" , date1= null , more... } |
1
|
Object { id= "85" , player= "Axtell, Ray" , date1= null , more... } |
2
|
Object { id= "175" , player= "Axtell, Ray" , date1= null , more... } |
3
|
Object { id= "97" , player= "Drake, Nelson" , date1= null , more... } |
4
|
Object { id= "21" , player= "Hope, Linda" , date1= "2015-01-26" , more... } |
5
|
Object { id= "90" , player= "Hope, Linda" , date1= null , more... } |
6
|