最終更新:2018-02-15 (木) 05:30:01 (2260d)
$.ajax
Top / $.ajax
Perform an asynchronous HTTP (Ajax) request.
http://api.jquery.com/jQuery.ajax/
$.ajax({ url: "test.html", context: document.body }).done(function() { $( this ).addClass( "done" ); });
dataType
- default: Intelligent Guess (xml, json, script, or html)
- xml
- html
- script
- json
- jsonp
- text
settings
success Function( Anything data, String textStatus, jqXHR jqXHR ) error Function( jqXHR jqXHR, String textStatus, String errorThrown ) complete Function( jqXHR jqXHR, String textStatus ) after success and error callbacks are executed
textStatus
error "timeout", "error", "abort", and "parsererror" complete "success", "notmodified", "nocontent", "error", "timeout", "abort", or "parsererror"
戻り値
- jqXHRオブジェクト (jQuery 1.5~)、XMLHTTPRequest?のスーパーセット
jqXHR
イベント
メモ
- 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.