I have a JSON object that contains a value I want to automatically update on my webpage. The JSON object is being retreived from a google sheets file using:
function getData() {
return $.ajax({
url: 'https://spreadsheets.google.com/feeds/cells/1r56MJc7DVUVSkQ-cYdonqdSGXh5x8nRum4dIGMN89j0/1/public/values/R29C4?alt=json-in-script&callback=importGSS',
dataType: 'jsonp',
jsonpCallback: 'importGSS'
})
}
var obj;
getData().done(function (data) {
obj = data;
});
(Thanks to user Andy for this!)
I can access the value by obj["entry"]["content"]["$t"] but I am not sure how to add this value to my paragraph element so that it automatically updates when the value changes in the object.
Could someone explain the best way to do this?
Thank you
$('p').html(obj["entry"]["content"]["$t"]);