0

I've built a web-app to run on an iPad, effectively functioning as a kiosk. The app collects basic data like Name, Address and Email. This is then sent to a remote MySQL database.

Is there any way I can safeguard the entries in the event that WiFi/3G connectivity drops? For example, failed submissions could be stored in an array or localStorage until a connection is re-established.

Does this sound feasible?

thv20
  • 986
  • 4
  • 13
  • 26
  • It's a little more complicated. The request could succeed in putting the info into the DB but wifi could fail before the server responds. You need to think through as many possible scenarios as you can. – James Thiele Sep 18 '12 at 15:57
  • I see, hmm. Might take a look at HTML5's IndexedDB instead. Thanks for your help. – thv20 Sep 18 '12 at 22:43

1 Answers1

0

I found that this was an overcomplicated way of solving a simple problem. I'm now saving JSON strings to localStorage and pushing those those to the live server every n seconds. Check for window.navigator.online; if the AJAX request succeeds then localStorage records are erased.

thv20
  • 986
  • 4
  • 13
  • 26