I'm writing a code to compare the result of getJson by capturing its result from a previous data. But I'm not sure where to put the correct code?
Result of data:
Sample code:
var prevData = JSON.stringify("");
function startRefreshTable() {
$.getJSON('/tablestatus/', function(data) {
if (data !== prevData){
//perform something here
}
prevData = data;
}
Thanks