Renamed preprocess to before, for consistency with form plugin

This commit is contained in:
Jörn Zaefferer 2006-12-04 19:40:25 +00:00
parent a6ce303187
commit 2bdd208e41
2 changed files with 5 additions and 5 deletions

View file

@ -484,7 +484,7 @@ jQuery.extend({
* (Boolean) async - By default, all requests are send asynchronous (set to true). * (Boolean) async - By default, all requests are send asynchronous (set to true).
* If you need synchronous requests, set this option to false. * 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. * XMLHttpRequest is passed as the only argument.
* *
* @example $.ajax({ * @example $.ajax({
@ -525,7 +525,7 @@ jQuery.extend({
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
processData: true, processData: true,
async: true, async: true,
preprocess: null before: null
}, s); }, s);
// if data available // if data available
@ -568,8 +568,8 @@ jQuery.extend({
xml.setRequestHeader("Connection", "close"); xml.setRequestHeader("Connection", "close");
// Allow custom headers/mimetypes // Allow custom headers/mimetypes
if( s.preprocess ) if( s.before )
s.preprocess(xml); s.before(xml);
// Wait for a response to come back // Wait for a response to come back
var onreadystatechange = function(isTimeout){ var onreadystatechange = function(isTimeout){

View file

@ -286,7 +286,7 @@ test("$.ajax - preprocess", function() {
$.ajax({ $.ajax({
url: "data/name.php", url: "data/name.php",
data: {'req': true}, data: {'req': true},
preprocess: function(xml) { before: function(xml) {
xml.setRequestHeader('customHeader', customHeader) xml.setRequestHeader('customHeader', customHeader)
}, },
success: function(data) { success: function(data) {