Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
2bdd208e
Commit
2bdd208e
authored
Dec 04, 2006
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed preprocess to before, for consistency with form plugin
parent
a6ce3031
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ajax.js
src/ajax/ajax.js
+4
-4
ajaxTest.js
src/ajax/ajaxTest.js
+1
-1
No files found.
src/ajax/ajax.js
View file @
2bdd208e
...
...
@@ -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
){
...
...
src/ajax/ajaxTest.js
View file @
2bdd208e
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment