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.
- $('td[id^="someElement"]').unbind();
$('td[id^="someElement"]').each(function() {
- blah blah
- });
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.
- $('#somePage').on('pagebeforeshow', function() {
console.log("Updating app cache");
AppCache.update(); <- Executes over and over
- )};
Thanks,
-Adam