git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The default for .clone() is to not clone any events. Fixes #8123.
[jquery.git]
/
src
/
ajax.js
diff --git
a/src/ajax.js
b/src/ajax.js
index
39abe90
..
3158ca4
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-322,9
+322,8
@@
jQuery.extend({
// Main method
ajax: function( url, options ) {
// Main method
ajax: function( url, options ) {
- // If options is not an object,
- // we simulate pre-1.5 signature
- if ( typeof options !== "object" ) {
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
options = url;
url = undefined;
}
options = url;
url = undefined;
}
@@
-350,6
+349,8
@@
jQuery.extend({
completeDeferred = jQuery._Deferred(),
// Status-dependent callbacks
statusCode = s.statusCode || {},
completeDeferred = jQuery._Deferred(),
// Status-dependent callbacks
statusCode = s.statusCode || {},
+ // ifModified key
+ ifModifiedKey,
// Headers (they are sent all at once)
requestHeaders = {},
// Response headers
// Headers (they are sent all at once)
requestHeaders = {},
// Response headers
@@
-453,10
+454,10
@@
jQuery.extend({
if ( s.ifModified ) {
if ( ( lastModified = jXHR.getResponseHeader( "Last-Modified" ) ) ) {
if ( s.ifModified ) {
if ( ( lastModified = jXHR.getResponseHeader( "Last-Modified" ) ) ) {
- jQuery.lastModified[ s.url ] = lastModified;
+ jQuery.lastModified[ ifModifiedKey ] = lastModified;
}
if ( ( etag = jXHR.getResponseHeader( "Etag" ) ) ) {
}
if ( ( etag = jXHR.getResponseHeader( "Etag" ) ) ) {
- jQuery.etag[ s.url ] = etag;
+ jQuery.etag[ ifModifiedKey ] = etag;
}
}
}
}
@@
-590,6
+591,9
@@
jQuery.extend({
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
}
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
}
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
// Add anti-cache in url if needed
if ( s.cache === false ) {
// Add anti-cache in url if needed
if ( s.cache === false ) {
@@
-609,11
+613,12
@@
jQuery.extend({
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
- if ( jQuery.lastModified[ s.url ] ) {
- requestHeaders[ "if-modified-since" ] = jQuery.lastModified[ s.url ];
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ requestHeaders[ "if-modified-since" ] = jQuery.lastModified[ ifModifiedKey ];
}
}
- if ( jQuery.etag[ s.url ] ) {
- requestHeaders[ "if-none-match" ] = jQuery.etag[ s.url ];
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ requestHeaders[ "if-none-match" ] = jQuery.etag[ ifModifiedKey ];
}
}
}
}