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
d1931a82
Commit
d1931a82
authored
Apr 29, 2010
by
malsup
Committed by
John Resig
Jun 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for
http://dev.jquery.com/ticket/6451
parent
1533bf7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
+24
-10
ajax.js
src/ajax.js
+18
-10
ajax.js
test/unit/ajax.js
+6
-0
No files found.
src/ajax.js
View file @
d1931a82
...
@@ -237,17 +237,24 @@ jQuery.extend({
...
@@ -237,17 +237,24 @@ jQuery.extend({
s
.
dataType
=
"script"
;
s
.
dataType
=
"script"
;
// Handle JSONP-style loading
// Handle JSONP-style loading
window
[
jsonp
]
=
window
[
jsonp
]
||
function
(
tmp
)
{
var
customJsonp
=
window
[
jsonp
];
window
[
jsonp
]
=
function
(
tmp
)
{
data
=
tmp
;
data
=
tmp
;
jQuery
.
ajax
.
handleSuccess
(
s
,
xhr
,
status
,
data
);
jQuery
.
ajax
.
handleSuccess
(
s
,
xhr
,
status
,
data
);
jQuery
.
ajax
.
handleComplete
(
s
,
xhr
,
status
,
data
);
jQuery
.
ajax
.
handleComplete
(
s
,
xhr
,
status
,
data
);
// Garbage collect
window
[
jsonp
]
=
undefined
;
if
(
jQuery
.
isFunction
(
customJsonp
)
)
{
customJsonp
(
tmp
);
try
{
}
delete
window
[
jsonp
];
else
{
}
catch
(
jsonpError
)
{}
// Garbage collect
window
[
jsonp
]
=
undefined
;
try
{
delete
window
[
jsonp
];
}
catch
(
jsonpError
)
{}
}
if
(
head
)
{
if
(
head
)
{
head
.
removeChild
(
script
);
head
.
removeChild
(
script
);
}
}
...
@@ -436,8 +443,9 @@ jQuery.extend({
...
@@ -436,8 +443,9 @@ jQuery.extend({
}
}
// Fire the complete handlers
// Fire the complete handlers
jQuery
.
ajax
.
handleComplete
(
s
,
xhr
,
status
,
data
);
if
(
!
jsonp
)
{
jQuery
.
ajax
.
handleComplete
(
s
,
xhr
,
status
,
data
);
}
if
(
isTimeout
===
"timeout"
)
{
if
(
isTimeout
===
"timeout"
)
{
xhr
.
abort
();
xhr
.
abort
();
}
}
...
...
test/unit/ajax.js
View file @
d1931a82
...
@@ -1225,6 +1225,12 @@ test("jQuery.ajax - Etag support", function() {
...
@@ -1225,6 +1225,12 @@ test("jQuery.ajax - Etag support", function() {
});
});
});
});
test
(
"jQuery.ajax - active counter"
,
function
()
{
ok
(
jQuery
.
ajax
.
active
==
0
,
"ajax active counter should be zero: "
+
jQuery
.
ajax
.
active
);
});
}
}
//}
//}
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