AEMLoviji
AEMLoviji

Reputation: 3257

Do not call BlockUI for ajax calls which take little time

I'm using jQuery BlockUI. In every AjaxCall i am blocking form with BlockUI Plugin. But Ajax request may continue 1 second or maybe more than minute. so i don't want to block form when request will take a few second. how i can do it?

Upvotes: 3

Views: 553

Answers (1)

Nifle
Nifle

Reputation: 11933

Can't be done.

How is your code going to know what ajax calls are going to be simple beforehand?

Code: "I'll start blocking now...."
Code: "What? Already done? But it was only 1.5 seconds and I'm only supposed to block if the request takes longer than 5 seconds."
Code: "I'll have to send a message back in time to myself and tell me not to block this call."

It's up to you to determine when to use BlockUI or not.

Upvotes: 3

Related Questions