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
73c1ceaf
Commit
73c1ceaf
authored
Jul 13, 2014
by
Dan Hart
Committed by
Timmy Willison
Nov 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajax: Fix for request aborted in ajaxSend
Fixes gh-1775 Close gh-1619
parent
2a3018ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
ajax.js
src/ajax.js
+6
-0
ajax.js
test/unit/ajax.js
+17
-0
No files found.
src/ajax.js
View file @
73c1ceaf
...
@@ -644,6 +644,12 @@ jQuery.extend({
...
@@ -644,6 +644,12 @@ jQuery.extend({
if
(
fireGlobals
)
{
if
(
fireGlobals
)
{
globalEventContext
.
trigger
(
"ajaxSend"
,
[
jqXHR
,
s
]
);
globalEventContext
.
trigger
(
"ajaxSend"
,
[
jqXHR
,
s
]
);
}
}
// If request was aborted inside ajaxSend, stop there
if
(
state
===
2
)
{
return
jqXHR
;
}
// Timeout
// Timeout
if
(
s
.
async
&&
s
.
timeout
>
0
)
{
if
(
s
.
async
&&
s
.
timeout
>
0
)
{
timeoutTimer
=
setTimeout
(
function
()
{
timeoutTimer
=
setTimeout
(
function
()
{
...
...
test/unit/ajax.js
View file @
73c1ceaf
...
@@ -435,6 +435,23 @@ module( "ajax", {
...
@@ -435,6 +435,23 @@ module( "ajax", {
};
};
});
});
ajaxTest
(
"#15160 - jQuery.ajax() - request manually aborted in ajaxSend"
,
3
,
{
setup
:
function
()
{
jQuery
(
document
).
on
(
"ajaxSend"
,
function
(
e
,
jqXHR
)
{
jqXHR
.
abort
();
});
jQuery
(
document
).
on
(
"ajaxError ajaxComplete"
,
function
(
e
,
jqXHR
)
{
equal
(
jqXHR
.
statusText
,
"abort"
,
"jqXHR.statusText equals abort on global ajaxComplete and ajaxError events"
);
});
},
url
:
url
(
"data/name.html"
),
error
:
true
,
complete
:
function
()
{
ok
(
true
,
"complete"
);
}
});
ajaxTest
(
"jQuery.ajax() - context modification"
,
1
,
{
ajaxTest
(
"jQuery.ajax() - context modification"
,
1
,
{
url
:
url
(
"data/name.html"
),
url
:
url
(
"data/name.html"
),
context
:
{},
context
:
{},
...
...
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