I use ajax in my phonegap application to load content for different pages. I also use onhashchange to enable button functionality.
At first, everything works fine, but if I click 3 different links (and trigger 3 hash changes), then my application will completely crash, stop responding, and then eats up all my memory.
Below is the hash change code, anyone has any idea why this could be a crash / memory leak?
$('a.ajax').click(function () { location.hash = $(this).attr('href').match(/(^.*)\./)[1] return false }) function hashChange() { var page = location.hash.slice(1) if (page != "" && window.location.hash) { wrap.load('pages/' + page + ".html .page-wrapper", function(){ closeMenu(); }) }else{ wrap.load('pages/Welcome.html .page-wrapper', function(){ closeMenu(); }) } }
Just to notice, I get the following error in the xCode console and I run version 2.9 of phonegap
CDVWebViewDelegate: Navigation starts when state = 1
Thanks!
source share