The jQuery documentation fails to provide information about exactly what options you can pass to $.ajax. So here is my quick-and-dirty list:
- url: string (location.href)
- global: bool (true) — whether to trigger the global ajax events
- type: “GET”/”POST” (“GET”)
- contentType: string (“application/x-www-form-urlencoded”)
- processData: bool (true)
- async: bool (true)
- timeout: int (null)
- data: object (null)
- username: string (null)
- password: string (null)
- xhr: function – creates the XMLHttpRequest object
- accepts: object ({ xml: “application/xml, text/xml”, html: “text/html”, script: “text/javascript, application/javascript”, json: “application/json, text/javascript”, text: “text/plain”, _default: “*/*” })
- dataType: “html”/”text”/”xml”/”json”/”jsonp”/”script”
- cache: bool (true, unless dataType=script)
- ifModified: bool (false) — set the If-Modified-Since header (to last request time)
- beforeSend: function(xhr, settings) (null) — return false to cancel
- success: function(data, “success”) (null)
- complete: function(xhr, status) (null) — status is “timeout”/”error”/”notmodified”/”success”/”parsererror”
- error: function(data, status) (null) — status is “timeout”/”error”/”parsererror
Note to self: format this into a table at some point.
Edit: the documentation has now been fixed, and includes all the options.
