diff --git a/plugins/jquery.showinfo.js b/plugins/jquery.showinfo.js index d38cff6c4..8c4e01c2d 100644 --- a/plugins/jquery.showinfo.js +++ b/plugins/jquery.showinfo.js @@ -89,10 +89,18 @@ return this.each(function() { var obj = $(this); - var sd; + var sd = null; getServerData(); + //refresh the UI to update the elapsed/remaining time + setInterval(updateWidget, 1000); + function updateWidget(){ + + if (sd == null){ + return; + } + var currentShow = sd.getCurrentShow(); var nextShows = sd.getNextShows(); @@ -126,14 +134,10 @@ "" + "" + ""); - - //refresh the UI to update the elapsed/remaining time - setTimeout(updateWidget, 1000); } function processData(data){ sd = new ScheduleData(data); - updateWidget(); } function airtimeScheduleJsonpError(jqXHR, textStatus, errorThrown){