jQuery ajaxStart()メソッド
例
AJAXリクエストの開始時に「読み込み中」のインジケーター画像を表示します。
$(document).ajaxStart(function(){
$(this).html("<img src='demo_wait.gif'>");
});
定義と使用法
ajaxStart()メソッドは、AJAXリクエストの開始時に実行される関数を指定します。
注: jQueryバージョン1.8以降、このメソッドはドキュメントにのみ添付する必要があります。
構文
$(document).ajaxStart(function())
Parameter | Description |
---|---|
function() | Required. Specifies the function to run when the AJAX request starts |