I'm currently using the current bit of html for jQuery Mobile page transitions:
<a href="#page2" data-role="button" data-transition="flip" onclick="save()">page2</a>
The save()
function here is something that saves the canvas
on the current page.
It seems however the save()
function runs asynchronously along with the page transition and hence at times the page transitions without having managed to fully save the information I wanted it to.
Is there a way to completely finish a function before jQuery Mobile executes the page transition?
--update--
Here's a jsFiddle example for all to play around with:
http://jsfiddle.net/nMR85/1291/
(notice the pagebeforechange
firing before the save trigger
in the console)