简体   繁体   中英

Kiosk web-app: re-submit data after failed request

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM