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
ff951314
Commit
ff951314
authored
Nov 08, 2013
by
Oleg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old try...catch for old FF
parent
c6de8210
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
52 deletions
+42
-52
xhr.js
src/ajax/xhr.js
+42
-52
No files found.
src/ajax/xhr.js
View file @
ff951314
...
@@ -90,59 +90,49 @@ if ( xhrSupported ) {
...
@@ -90,59 +90,49 @@ if ( xhrSupported ) {
callback
=
function
(
_
,
isAbort
)
{
callback
=
function
(
_
,
isAbort
)
{
var
status
,
statusText
,
responses
;
var
status
,
statusText
,
responses
;
// Firefox throws exceptions when accessing properties
// Was never called and is aborted or complete
// of an xhr when a network error occurred
if
(
callback
&&
(
isAbort
||
xhr
.
readyState
===
4
)
)
{
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
// Clean up
try
{
delete
xhrCallbacks
[
id
];
callback
=
undefined
;
// Was never called and is aborted or complete
xhr
.
onreadystatechange
=
jQuery
.
noop
;
if
(
callback
&&
(
isAbort
||
xhr
.
readyState
===
4
)
)
{
// Clean up
// Abort manually if needed
delete
xhrCallbacks
[
id
];
if
(
isAbort
)
{
callback
=
undefined
;
if
(
xhr
.
readyState
!==
4
)
{
xhr
.
onreadystatechange
=
jQuery
.
noop
;
xhr
.
abort
();
}
// Abort manually if needed
}
else
{
if
(
isAbort
)
{
responses
=
{};
if
(
xhr
.
readyState
!==
4
)
{
status
=
xhr
.
status
;
xhr
.
abort
();
}
// Support: IE<10
}
else
{
// Accessing binary-data responseText throws an exception
responses
=
{};
// (#11426)
status
=
xhr
.
status
;
if
(
typeof
xhr
.
responseText
===
"string"
)
{
responses
.
text
=
xhr
.
responseText
;
// Support: IE<10
}
// Accessing binary-data responseText throws an exception
// (#11426)
// Firefox throws an exception when accessing
if
(
typeof
xhr
.
responseText
===
"string"
)
{
// statusText for faulty cross-domain requests
responses
.
text
=
xhr
.
responseText
;
try
{
}
statusText
=
xhr
.
statusText
;
}
catch
(
e
)
{
// Firefox throws an exception when accessing
// We normalize with Webkit giving an empty statusText
// statusText for faulty cross-domain requests
statusText
=
""
;
try
{
}
statusText
=
xhr
.
statusText
;
}
catch
(
e
)
{
// Filter status for non standard behaviors
// We normalize with Webkit giving an empty statusText
statusText
=
""
;
// If the request is local and we have data: assume a success
}
// (success with no data won't get notified, that's the best we
// can do given current implementations)
// Filter status for non standard behaviors
if
(
!
status
&&
options
.
isLocal
&&
!
options
.
crossDomain
)
{
status
=
responses
.
text
?
200
:
404
;
// If the request is local and we have data: assume a success
// IE - #1450: sometimes returns 1223 when it should be 204
// (success with no data won't get notified, that's the best we
}
else
if
(
status
===
1223
)
{
// can do given current implementations)
status
=
204
;
if
(
!
status
&&
options
.
isLocal
&&
!
options
.
crossDomain
)
{
status
=
responses
.
text
?
200
:
404
;
// IE - #1450: sometimes returns 1223 when it should be 204
}
else
if
(
status
===
1223
)
{
status
=
204
;
}
}
}
}
}
catch
(
firefoxAccessException
)
{
if
(
!
isAbort
)
{
complete
(
-
1
,
firefoxAccessException
);
}
}
}
}
...
...
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