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
31949fa5
Commit
31949fa5
authored
Feb 01, 2011
by
Dan Heberden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 8107; Fix argument handling for $.ajax for multiple method signatues and add test case
parent
f43572d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
ajax.js
src/ajax.js
+2
-3
ajax.js
test/unit/ajax.js
+19
-0
No files found.
src/ajax.js
View file @
31949fa5
...
@@ -322,9 +322,8 @@ jQuery.extend({
...
@@ -322,9 +322,8 @@ jQuery.extend({
// Main method
// Main method
ajax
:
function
(
url
,
options
)
{
ajax
:
function
(
url
,
options
)
{
// If options is not an object,
// If url is an object, simulate pre-1.5 signature
// we simulate pre-1.5 signature
if
(
typeof
url
===
"object"
)
{
if
(
typeof
options
!==
"object"
)
{
options
=
url
;
options
=
url
;
url
=
undefined
;
url
=
undefined
;
}
}
...
...
test/unit/ajax.js
View file @
31949fa5
...
@@ -2161,6 +2161,25 @@ test("jQuery.ajax - active counter", function() {
...
@@ -2161,6 +2161,25 @@ test("jQuery.ajax - active counter", function() {
ok
(
jQuery
.
active
==
0
,
"ajax active counter should be zero: "
+
jQuery
.
active
);
ok
(
jQuery
.
active
==
0
,
"ajax active counter should be zero: "
+
jQuery
.
active
);
});
});
test
(
"jQuery.ajax - multiple method signatures introduced in 1.5 ( #8107)"
,
4
,
function
()
{
expect
(
3
);
var
i
=
3
;
jQuery
.
ajaxSetup
({
success
:
function
()
{
ok
(
true
,
"Success"
);
if
(
!
--
i
)
start
();
}});
stop
();
jQuery
.
ajax
(
'data/name.html'
);
jQuery
.
ajax
(
'data/name.html'
,
{}
);
jQuery
.
ajax
({
url
:
'data/name.html'
}
);
jQuery
.
ajaxSetup
({
success
:
null
});
});
}
}
//}
//}
\ No newline at end of file
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