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
6bed348a
Commit
6bed348a
authored
May 01, 2012
by
Oleg
Committed by
Rick Waldron waldron.rick@gmail.com
May 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jQuery.ajaxSetup() data is merged with params. Fixes #10524
parent
dc3c983b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
ajax.js
src/ajax.js
+0
-1
ajax.js
test/unit/ajax.js
+19
-1
No files found.
src/ajax.js
View file @
6bed348a
...
@@ -183,7 +183,6 @@ jQuery.fn.extend({
...
@@ -183,7 +183,6 @@ jQuery.fn.extend({
// Otherwise, build a param string
// Otherwise, build a param string
}
else
if
(
typeof
params
===
"object"
)
{
}
else
if
(
typeof
params
===
"object"
)
{
params
=
jQuery
.
param
(
params
,
jQuery
.
ajaxSettings
.
traditional
);
type
=
"POST"
;
type
=
"POST"
;
}
}
}
}
...
...
test/unit/ajax.js
View file @
6bed348a
...
@@ -1257,6 +1257,24 @@ test("load(String, String, Function)", function() {
...
@@ -1257,6 +1257,24 @@ test("load(String, String, Function)", function() {
});
});
});
});
asyncTest
(
"load() - #10524"
,
1
,
function
()
{
jQuery
.
ajaxSetup
({
data
:
{
foo
:
"bar"
}
});
var
data
=
{
baz
:
1
};
jQuery
(
"#foo"
).
load
(
"data/echoQuery.php"
,
data
).
ajaxComplete
(
function
(
event
,
jqXHR
,
options
)
{
ok
(
~
options
.
data
.
indexOf
(
"foo=bar"
),
"Data from ajaxSettings was used"
);
jQuery
.
ajaxSetup
({
data
:
null
});
start
();
});
});
test
(
"jQuery.get(String, Function) - data in ajaxSettings (#8277)"
,
function
()
{
test
(
"jQuery.get(String, Function) - data in ajaxSettings (#8277)"
,
function
()
{
expect
(
1
);
expect
(
1
);
stop
();
stop
();
...
@@ -2411,4 +2429,4 @@ test("jQuery.ajax - active counter", function() {
...
@@ -2411,4 +2429,4 @@ 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
);
});
});
}
}
\ 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