Trying to have something execute on a particular page, only once

Trying to have something execute on a particular page, only once


   Hi folks,

   I've seen many others post about similar things, where they have events firing for the number of pages that have been visited, and I've gotten around the problem by unbinding my events prior to binding them, like so.

  1.          $('td[id^="someElement"]').unbind();
             $('td[id^="someElement"]').each(function() {
  2.                blah blah
  3.          });
   But now I'm trying to have my application cache check for updates when a specific page is visited, and it's behaving the same way as the events used to, executing once for each page that has been visited prior.

   So my code looks like this, any advice would be appreciated.
 
  1.       $('#somePage').on('pagebeforeshow', function() {
             console.log("Updating app cache");

             AppCache.update();    <- Executes over and over


  2.       )};
      Thanks,

         -Adam