15
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jQuery BlockUI Pluginと$.ajax()を使って通信中を演出する

Posted at

jQuery BlockUI Pluginという、それっぽく通信中などのブロック演出をしてくれるプラグインがあって愛用しています。
これとjqueryの$.ajax()でDeferredな書き方が非常に相性が良いのでメモ。

$.blockUI({
	//	メッセージとかのBlockUIの設定
});
/**
	↑でブロック画面を出してから
*/
$.ajax({
	//	Request MethodやURLなどの設定
}).success(function(result){
	//	正常終了
}).error(function(jqHXR){
	//	エラー処理(404とか色々)
}).always(function(){
	//	常に行う処理の一環としてブロック画面解除
	$.unblockUI();
});
15
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?