最終更新:2019-06-27 (木) 18:55:29 (18d)  

jQuery.ajax はてなブックマークを見る
Top / jQuery.ajax

http://api.jquery.com/jquery.ajax/

  • $.ajax({
      type: リクエストタイプ,
      url:  リクエスト送信先のURL,
      data: URLのクエリ(パラメータ),
    }).done(function(data, textStatus, jqXHR){
      // 成功の場合の処理
    }).fail(function(jqXHR, textStatus, errorThrown){
      // エラーの場合処理
    });

パラメータ

data

  • PlainObject? or String or Array
  • If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting

processData

  • By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded"

メモ

  • jqXHR.success(), jqXHR.error?(), and jqXHR.complete?() callbacks are removed as of jQuery 3.0.
  • You can use jqXHR.done?(), jqXHR.fail?(), and jqXHR.always?() instead.

関連