aboutsummaryrefslogtreecommitdiffstats
path: root/src/ajax
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2006-12-22 14:40:46 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2006-12-22 14:40:46 +0000
commitbfdf836da9cf5d0ebd1d6a50c0174bb5b3922d52 (patch)
treebad74cd11e1bfa83a6332e45dd7805d0f9f273a6 /src/ajax
parentfc84b9db10da2f69a830dbb9aa78b9c214b297ae (diff)
downloadjquery-bfdf836da9cf5d0ebd1d6a50c0174bb5b3922d52.tar.gz
jquery-bfdf836da9cf5d0ebd1d6a50c0174bb5b3922d52.zip
Documentation for $.ajaxSetup
Diffstat (limited to 'src/ajax')
-rw-r--r--src/ajax/ajax.js28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/ajax/ajax.js b/src/ajax/ajax.js
index b6a18f4f2..c860b632b 100644
--- a/src/ajax/ajax.js
+++ b/src/ajax/ajax.js
@@ -419,6 +419,8 @@ jQuery.extend({
* You can manually abort requests with the XMLHttpRequest's (returned by
* all ajax functions) abort() method.
*
+ * Deprecated. Use $.ajaxSetup instead.
+ *
* @example $.ajaxTimeout( 5000 );
* @desc Make all AJAX requests timeout after 5 seconds.
*
@@ -428,18 +430,31 @@ jQuery.extend({
* @cat AJAX
*/
ajaxTimeout: function(timeout) {
- //jQuery.timeout = timeout;
jQuery.ajaxSettings.timeout = timeout;
},
+ /**
+ * Setup global settings for AJAX requests.
+ *
+ * See $.ajax for a description of all available options.
+ *
+ * @example $.ajaxSetup( {
+ * url: "/xmlhttp/",
+ * global: false,
+ * type: "POST"
+ * } );
+ * @desc Sets the defaults for AJAX requests to the url "/xmlhttp/",
+ * disables global handlers and uses POST instead of GET
+ *
+ * @name $.ajaxSetup
+ * @type undefined
+ * @param Object settings Key/value pairs for ajax options
+ * @cat AJAX
+ */
ajaxSetup: function(settings) {
jQuery.extend(jQuery.ajaxSettings, settings);
},
- // Last-Modified header cache for next request
- lastModified: {},
-
- // TODO document me
ajaxSettings: {
global: true,
type: "GET",
@@ -448,6 +463,9 @@ jQuery.extend({
processData: true,
async: true
},
+
+ // Last-Modified header cache for next request
+ lastModified: {},
/**
* Load a remote page using an HTTP request.