开发者

Do not call BlockUI for ajax calls which take little time

开发者 https://www.devze.com 2023-03-06 11:11 出处:网络
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 whe开发者_开发技巧

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 whe开发者_开发技巧n request will take a few second. how i can do it?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消