I am using the following script to get data from a Google Spreadsheet. From time to time the spreadsheet will be 'turned off' and the script will result in an error 403. I want to know how to check for that error and trigger another function when it does.
function loadJSON0() {
$(function checkJSON0() {
$.getJSON( https://spreadsheets.google.com/feeds/list/SPREADSHEETKEY/1//public/values?alt=json-in-script&callback=?,
function (data) {
$.each(data.feed.entry, function(i,entry) {
// do stuff
});
});
});
};