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
56a93fc2
Commit
56a93fc2
authored
Dec 14, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an extra try block to handle FF 3 x-domain requests. (Bug #1557)
parent
14a3a5bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
ajax.js
src/ajax.js
+12
-9
No files found.
src/ajax.js
View file @
56a93fc2
...
@@ -255,17 +255,20 @@ jQuery.extend({
...
@@ -255,17 +255,20 @@ jQuery.extend({
// Open the socket
// Open the socket
xml
.
open
(
s
.
type
,
s
.
url
,
s
.
async
);
xml
.
open
(
s
.
type
,
s
.
url
,
s
.
async
);
// Set the correct header, if data is being sent
// Need an extra try/catch for cross domain requests in Firefox 3
if
(
s
.
data
)
try
{
xml
.
setRequestHeader
(
"Content-Type"
,
s
.
contentType
);
// Set the correct header, if data is being sent
if
(
s
.
data
)
xml
.
setRequestHeader
(
"Content-Type"
,
s
.
contentType
);
// Set the If-Modified-Since header, if ifModified mode.
// Set the If-Modified-Since header, if ifModified mode.
if
(
s
.
ifModified
)
if
(
s
.
ifModified
)
xml
.
setRequestHeader
(
"If-Modified-Since"
,
xml
.
setRequestHeader
(
"If-Modified-Since"
,
jQuery
.
lastModified
[
s
.
url
]
||
"Thu, 01 Jan 1970 00:00:00 GMT"
);
jQuery
.
lastModified
[
s
.
url
]
||
"Thu, 01 Jan 1970 00:00:00 GMT"
);
// Set header so the called script knows that it's an XMLHttpRequest
// Set header so the called script knows that it's an XMLHttpRequest
xml
.
setRequestHeader
(
"X-Requested-With"
,
"XMLHttpRequest"
);
xml
.
setRequestHeader
(
"X-Requested-With"
,
"XMLHttpRequest"
);
}
catch
(
e
){}
// Allow custom headers/mimetypes
// Allow custom headers/mimetypes
if
(
s
.
beforeSend
)
if
(
s
.
beforeSend
)
...
...
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