Renamed preprocess to before, for consistency with form plugin
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 4 Dec 2006 19:40:25 +0000 (19:40 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 4 Dec 2006 19:40:25 +0000 (19:40 +0000)
src/ajax/ajax.js
src/ajax/ajaxTest.js

index fe83993..cf6298d 100644 (file)
@@ -484,7 +484,7 @@ jQuery.extend({
         * (Boolean) async - By default, all requests are send asynchronous (set to true).
         * If you need synchronous requests, set this option to false.
         *
-        * (Function) preprocess - A pre-callback to set custom headers etc., the
+        * (Function) before - A pre-callback to set custom headers etc., the
         * XMLHttpRequest is passed as the only argument.
         *
         * @example $.ajax({
@@ -525,7 +525,7 @@ jQuery.extend({
                        contentType: "application/x-www-form-urlencoded",
                        processData: true,
                        async: true,
-                       preprocess: null
+                       before: null
                }, s);
 
                // if data available
@@ -568,8 +568,8 @@ jQuery.extend({
                        xml.setRequestHeader("Connection", "close");
                        
                // Allow custom headers/mimetypes
-               if( s.preprocess )
-                       s.preprocess(xml);
+               if( s.before )
+                       s.before(xml);
 
                // Wait for a response to come back
                var onreadystatechange = function(isTimeout){
index a84df1d..0a740aa 100644 (file)
@@ -286,7 +286,7 @@ test("$.ajax - preprocess", function() {
        $.ajax({
                url: "data/name.php", 
                data: {'req': true},
-               preprocess: function(xml) {
+               before: function(xml) {
                        xml.setRequestHeader('customHeader', customHeader)
                },
                success: function(data) {