hi,
i want to consume a JSON Webservice which return the following:
I want to loop through the data and put it for example in an HTML Table.
I tried the following:
But at console.log(response.firstname); and at console.log(response.GetDataResult.lastname); i get UNDEFINED! I see on the net that people are using the objects like response.dataresult.propertyname to return the info, but in my case it isn't working!
The desired output should be:
firstname1 lastname1
firstname2 lastname2
Whats wrong with my code?
console.log(JSON.stringify(response)); gives me the following
{"GetDataResult":[{"firstname":"firstname1","lastname":"lastname1"},{"firstname":"firstname2","lastname":"lastname2"}]}
regards
Yavuz