am fetching data from php as json
CODE:
I have added json_encode() to the php database output
JQUERY MOBILE:
$.getJSON('custom/php/showresults.php',
function(data){
console.log(data)
}
The console.log(data) outputs as:
{'name':'Geowan', 'surname':'hiu'}.
How can i change it to output in the object way so that i can access the data using data.name
data.name?