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
fade9769
Commit
fade9769
authored
Feb 22, 2007
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #991
parent
1878aa96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
ajax.js
src/ajax/ajax.js
+14
-8
No files found.
src/ajax/ajax.js
View file @
fade9769
...
@@ -647,6 +647,13 @@ jQuery.extend({
...
@@ -647,6 +647,13 @@ jQuery.extend({
// The transfer is complete and the data is available, or the request timed out
// The transfer is complete and the data is available, or the request timed out
if
(
xml
&&
(
xml
.
readyState
==
4
||
isTimeout
==
"timeout"
)
)
{
if
(
xml
&&
(
xml
.
readyState
==
4
||
isTimeout
==
"timeout"
)
)
{
requestDone
=
true
;
requestDone
=
true
;
// clear poll interval
if
(
ival
)
{
clearInterval
(
ival
);
ival
=
null
;
}
var
status
;
var
status
;
try
{
try
{
status
=
jQuery
.
httpSuccess
(
xml
)
&&
isTimeout
!=
"timeout"
?
status
=
jQuery
.
httpSuccess
(
xml
)
&&
isTimeout
!=
"timeout"
?
...
@@ -692,11 +699,13 @@ jQuery.extend({
...
@@ -692,11 +699,13 @@ jQuery.extend({
s
.
complete
(
xml
,
status
);
s
.
complete
(
xml
,
status
);
// Stop memory leaks
// Stop memory leaks
xml
.
onreadystatechange
=
function
(){};
if
(
s
.
async
)
xml
=
null
;
xml
=
null
;
}
}
};
};
xml
.
onreadystatechange
=
onreadystatechange
;
// don't attach the handler to the request, just poll it instead
var
ival
=
setInterval
(
onreadystatechange
,
13
);
// Timeout checker
// Timeout checker
if
(
s
.
timeout
>
0
)
if
(
s
.
timeout
>
0
)
...
@@ -711,12 +720,9 @@ jQuery.extend({
...
@@ -711,12 +720,9 @@ jQuery.extend({
}
}
},
s
.
timeout
);
},
s
.
timeout
);
// save non-leaking reference
var
xml2
=
xml
;
// Send the data
// Send the data
try
{
try
{
xml
2
.
send
(
s
.
data
);
xml
.
send
(
s
.
data
);
}
catch
(
e
)
{
}
catch
(
e
)
{
jQuery
.
handleError
(
s
,
xml
,
null
,
e
);
jQuery
.
handleError
(
s
,
xml
,
null
,
e
);
}
}
...
@@ -726,7 +732,7 @@ jQuery.extend({
...
@@ -726,7 +732,7 @@ jQuery.extend({
onreadystatechange
();
onreadystatechange
();
// return XMLHttpRequest to allow aborting the request etc.
// return XMLHttpRequest to allow aborting the request etc.
return
xml
2
;
return
xml
;
},
},
handleError
:
function
(
s
,
xml
,
status
,
e
)
{
handleError
:
function
(
s
,
xml
,
status
,
e
)
{
...
...
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