- * @test stop(); var counter = { complete: 0, success: 0, error: 0 };
- * var success = function() { counter.success++ };
- * var error = function() { counter.error++ };
- * var complete = function() { counter.complete++ };
- * $('#foo').ajaxStart(complete).ajaxStop(complete).ajaxComplete(complete).ajaxError(error).ajaxSuccess(success);
- * // start with successful test
- * $.ajax({url: "data/name.php", success: success, error: error, complete: function() {
- * ok( counter.error == 0, 'Check succesful request' );
- * ok( counter.success == 2, 'Check succesful request' );
- * ok( counter.complete == 3, 'Check succesful request' );
- * counter.error = 0; counter.success = 0; counter.complete = 0;
- * $.ajaxTimeout(500);
- * $.ajax({url: "data/name.php?wait=5", success: success, error: error, complete: function() {
- * ok( counter.error == 2, 'Check failed request' );
- * ok( counter.success == 0, 'Check failed request' );
- * ok( counter.complete == 3, 'Check failed request' );
- * start();
- * }});
- * }});
-
- * @test stop(); var counter = { complete: 0, success: 0, error: 0 };
- * counter.error = 0; counter.success = 0; counter.complete = 0;
- * var success = function() { counter.success++ };
- * var error = function() { counter.error++ };
- * $.ajaxTimeout(0);
- * $.ajax({url: "data/name.php", global: false, success: success, error: error, complete: function() {
- * ok( counter.error == 0, 'Check sucesful request without globals' );
- * ok( counter.success == 1, 'Check sucesful request without globals' );
- * ok( counter.complete == 0, 'Check sucesful request without globals' );
- * counter.error = 0; counter.success = 0; counter.complete = 0;
- * $.ajaxTimeout(500);
- * $.ajax({url: "data/name.php?wait=5", global: false, success: success, error: error, complete: function() {
- * ok( counter.error == 1, 'Check failed request without globals' );
- * ok( counter.success == 0, 'Check failed request without globals' );
- * ok( counter.complete == 0, 'Check failed request without globals' );
- * start();
- * }});
- * }});
- *
- * @name ajaxHandlersTesting
- * @private
+ * Attach a function to be executed before an AJAX request is sent.
+ *
+ * The XMLHttpRequest and settings used for that request are passed
+ * as arguments to the callback.
+ *
+ * @example $("#msg").ajaxSend(function(request, settings){
+ * $(this).append("<li>Starting request at " + settings.url + "</li>");
+ * });
+ * @desc Show a message before an AJAX request is sent.
+ *
+ * @name ajaxSend
+ * @type jQuery
+ * @param Function callback The function to execute.
+ * @cat Ajax