/    Sign up×
Community /Pin to ProfileBookmark

Any way to suspend the user for a moment from doing ANYTHING??

I’m writing an asynchronous script and I noticed that if the user clicks things too quickly, all the updates don’t get written.

I was wondering if anyone knew a way to suspend all user activity for a few seconds. Preferrably through a setInterval so I can match it to a condition.

Thanks

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJun 20.2006 — No easy way, no. However, if you need to suspend activity, you might as well be writing a synchronous script. :p
Copy linkTweet thisAlerts:
@slaughtersJun 20.2006 — phpnovice defintly has a point. Might as well as change the Ajax response to being synchronous instead of asynch.

But I've occasionally wanted an impatient user to just click "submit" on a form once (versus 5 or 6 times just because the connection is slow), so I've used the technique of positioning a div tag that says "WAIT" over parts of the screen I did not want the user to click on.
Copy linkTweet thisAlerts:
@JulianJJun 20.2006 — Untested, but something like this might work:

<div style='position:absolute;left:0px;top:0px;z-index:100;width:100%;height:100%;'></div>

Julian
Copy linkTweet thisAlerts:
@s_mkauthorJun 20.2006 — Doh! :o

meant synchronous....but not Ajax. I always get synch/async mixed up.


I'll try the giant div if all else fails, but I think I'll try to find a more elegant solution first. I'll post any solutions. But if someone as an alternate theory, please...let it fly.


thx a bunch

s_mk
×

Success!

Help @s_mk spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...