I am using Google Maps API with jQuery getJSON:
$.getJSON(requestUrl, function(data) { var distance = //need to parse value from \'data\' object here
var json = JSON.parse(data); distance= json["rows"]["elements"]["distance"]["text"];
Hope it helps