jQuery ajaxSend()メソッド

❮jQueryAJAXメソッド

AJAXリクエストが送信されようとしているときに、<div>要素の内容を変更します。

$(document).ajaxSend(function(e, xhr, opt){
  $("div").append("<p>Requesting: " + opt.url + "</p>");
});

定義と使用法

ajaxSend()メソッドは、AJAXリクエストが送信されようとしているときに実行する関数を指定します。

注: jQueryバージョン1.8以降、このメソッドはドキュメントにのみ添付する必要があります。


構文

$(document).ajaxSend(function(event,xhr,options))

Parameter Description
function(event,xhr,options) Required. Specifies the function to run if the request succeeds
Additional parameters:
  • event - contains the event object
  • xhr - contains the XMLHttpRequest object
  • options - contains the options used in the AJAX request

❮jQueryAJAXメソッド