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
06ee2c16
Commit
06ee2c16
authored
Dec 22, 2013
by
Oleg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajax: support non-RFC2616 methods for oldIE
Closes gh-1466 Fixes #13240
parent
f1af3c23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
xhr.js
src/ajax/xhr.js
+13
-2
ajax.js
test/unit/ajax.js
+11
-0
No files found.
src/ajax/xhr.js
View file @
06ee2c16
...
@@ -8,9 +8,20 @@ define([
...
@@ -8,9 +8,20 @@ define([
// (This is still attached to ajaxSettings for backward compatibility)
// (This is still attached to ajaxSettings for backward compatibility)
jQuery
.
ajaxSettings
.
xhr
=
window
.
ActiveXObject
!==
undefined
?
jQuery
.
ajaxSettings
.
xhr
=
window
.
ActiveXObject
!==
undefined
?
// Support: IE6+
// Support: IE6+
// XHR cannot access local files, always use ActiveX for that case
function
()
{
function
()
{
return
!
this
.
isLocal
&&
createStandardXHR
()
||
createActiveXHR
();
// XHR cannot access local files, always use ActiveX for that case
return
!
this
.
isLocal
&&
// Support: IE7-8
// oldIE XHR does not support non-RFC2616 methods (#13240)
// See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
// Although this check for six methods instead of eight
// since IE also does not support "trace" and "connect"
/^
(
get|post|head|put|delete|options
)
$/i
.
test
(
this
.
type
)
&&
createStandardXHR
()
||
createActiveXHR
();
}
:
}
:
// For all other browsers, use the standard XMLHttpRequest object
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR
;
createStandardXHR
;
...
...
test/unit/ajax.js
View file @
06ee2c16
...
@@ -1575,6 +1575,17 @@ module( "ajax", {
...
@@ -1575,6 +1575,17 @@ module( "ajax", {
}
}
}
);
}
);
ajaxTest
(
"#13240 - jQuery.ajax() - support non-RFC2616 methods"
,
1
,
{
url
:
"data/echoQuery.php"
,
method
:
"PATCH"
,
success
:
function
()
{
ok
(
true
,
"success"
);
},
error
:
function
()
{
ok
(
false
,
"error"
);
}
});
// Support: Chrome 31.
// Support: Chrome 31.
// Chrome 31 doesn't fire Ajax requests in beforeunload event handler.
// Chrome 31 doesn't fire Ajax requests in beforeunload event handler.
// There is no way for us to workaround it and it's been fixed in Chrome 32
// There is no way for us to workaround it and it's been fixed in Chrome 32
...
...
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