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
3e1d3d0f
Commit
3e1d3d0f
authored
Jan 20, 2011
by
jaubourg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revises the way arguments are handled in ajax.
parent
9ab00a71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
ajax.js
src/ajax.js
+6
-7
No files found.
src/ajax.js
View file @
3e1d3d0f
...
@@ -291,18 +291,16 @@ jQuery.extend({
...
@@ -291,18 +291,16 @@ jQuery.extend({
// Main method
// Main method
ajax
:
function
(
url
,
options
)
{
ajax
:
function
(
url
,
options
)
{
// Handle varargs
// If options is not an object,
if
(
arguments
.
length
===
1
)
{
// we simulate pre-1.5 signature
if
(
typeof
(
options
)
!==
"object"
)
{
options
=
url
;
options
=
url
;
url
=
options
?
options
.
url
:
undefined
;
url
=
undefined
;
}
}
// Force options to be an object
// Force options to be an object
options
=
options
||
{};
options
=
options
||
{};
// Get the url if provided separately
options
.
url
=
url
||
options
.
url
;
var
// Create the final options object
var
// Create the final options object
s
=
jQuery
.
extend
(
true
,
{}
,
jQuery
.
ajaxSettings
,
options
),
s
=
jQuery
.
extend
(
true
,
{}
,
jQuery
.
ajaxSettings
,
options
),
// jQuery lists
// jQuery lists
...
@@ -630,7 +628,8 @@ jQuery.extend({
...
@@ -630,7 +628,8 @@ jQuery.extend({
};
};
// Remove hash character (#7531: and string promotion)
// Remove hash character (#7531: and string promotion)
s
.
url
=
(
""
+
s
.
url
).
replace
(
rhash
,
""
);
// We also use the url parameter if available
s
.
url
=
(
""
+
(
url
||
s
.
url
)
).
replace
(
rhash
,
""
);
// Extract dataTypes list
// Extract dataTypes list
s
.
dataTypes
=
jQuery
.
trim
(
s
.
dataType
||
"*"
).
toLowerCase
().
split
(
/
\s
+/
);
s
.
dataTypes
=
jQuery
.
trim
(
s
.
dataType
||
"*"
).
toLowerCase
().
split
(
/
\s
+/
);
...
...
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