Brent
Brent

Reputation: 2485

Popup Force Browser Open Ajax

I'm building a mobile app website, but I have a really broad question which I'm not sure will be even possible to answer.

The web app website I'm building lets users submit data over the day, every 20 minutes or so it syncs their information to a server which can take upwards of 10 minutes with a poor signal.

What I don't want to happen is for the user to leave while the sync is in process - even though their data will still be ready for upload again, when they come back it would cost them unnecessary upload bandwidth on their tariff.

Basically I have some code which displays a loader but I don't think this is enough.

   $(document).ajaxStart(function () {
         $('.spinner').show();
   });

Would there be any way to force the user to keep on the browser, or page open until the ajax has stopped? Like a force popup - I know it seems annoying but it's in the best interest of the user.

Upvotes: 1

Views: 85

Answers (1)

Aboba
Aboba

Reputation: 286

Why not display a spinning logo while it's syncing. You could have it load at the start of the function then disable it on the callback. It's not going to force anything but it will be visually obvious to the user that something is happening.

Upvotes: 1

Related Questions