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
08d86586
Commit
08d86586
authored
Oct 01, 2006
by
Jörn Zaefferer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug #165 (ignoring the exception) and #156 (ifModified option added to $.ajax)
parent
e94db76a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
ajax.js
src/ajax/ajax.js
+12
-2
No files found.
src/ajax/ajax.js
View file @
08d86586
...
@@ -537,6 +537,10 @@ jQuery.extend({
...
@@ -537,6 +537,10 @@ jQuery.extend({
* (String) dataType - The type of data that you're expecting back from
* (String) dataType - The type of data that you're expecting back from
* the server (e.g. "xml", "html", "script", or "json").
* the server (e.g. "xml", "html", "script", or "json").
*
*
* (Boolean) ifModified - Allow the request to be successful only if the
* response has changed since the last request, default is false, ignoring
* the Last-Modified header
*
* (Number) timeout - Local timeout to override global timeout, eg. to give a
* (Number) timeout - Local timeout to override global timeout, eg. to give a
* single request a longer timeout while all others timeout after 1 seconds,
* single request a longer timeout while all others timeout after 1 seconds,
* see $.ajaxTimeout
* see $.ajaxTimeout
...
@@ -610,6 +614,7 @@ jQuery.extend({
...
@@ -610,6 +614,7 @@ jQuery.extend({
var
dataType
=
type
.
dataType
;
var
dataType
=
type
.
dataType
;
var
global
=
typeof
type
.
global
==
"boolean"
?
type
.
global
:
true
;
var
global
=
typeof
type
.
global
==
"boolean"
?
type
.
global
:
true
;
var
timeout
=
typeof
type
.
timeout
==
"number"
?
type
.
timeout
:
jQuery
.
timeout
;
var
timeout
=
typeof
type
.
timeout
==
"number"
?
type
.
timeout
:
jQuery
.
timeout
;
var
ifModified
=
type
.
ifModified
||
false
;
data
=
type
.
data
;
data
=
type
.
data
;
url
=
type
.
url
;
url
=
type
.
url
;
type
=
type
.
type
;
type
=
type
.
type
;
...
@@ -655,8 +660,13 @@ jQuery.extend({
...
@@ -655,8 +660,13 @@ jQuery.extend({
// Make sure that the request was successful or notmodified
// Make sure that the request was successful or notmodified
if
(
status
!=
"error"
)
{
if
(
status
!=
"error"
)
{
// Cache Last-Modified header, if ifModified mode.
// Cache Last-Modified header, if ifModified mode.
var
modRes
=
xml
.
getResponseHeader
(
"Last-Modified"
);
var
modRes
;
if
(
ifModified
&&
modRes
)
jQuery
.
lastModified
[
url
]
=
modRes
;
try
{
modRes
=
xml
.
getResponseHeader
(
"Last-Modified"
);
}
catch
(
e
)
{}
// swallow exception thrown by FF if header is not available
if
(
ifModified
&&
modRes
)
jQuery
.
lastModified
[
url
]
=
modRes
;
// If a local callback was specified, fire it
// If a local callback was specified, fire it
if
(
success
)
if
(
success
)
...
...
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