File tree Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -87,14 +87,13 @@ var ajax = function ajax(options) {
87
87
} ;
88
88
89
89
request . withCredentials = options . xhrFields . withCredentials ;
90
- var cacheBuster = "& _=" + new Date ( ) . getTime ( ) ;
90
+ var cacheBuster = "_=" + new Date ( ) . getTime ( ) ;
91
91
if ( options . url . indexOf ( "?" ) === - 1 ) {
92
- options . url += "?" ;
93
- }
94
- if ( options . url . indexOf ( "&_=" ) === - 1 ) {
95
- options . url += cacheBuster ;
92
+ options . url += "?" + cacheBuster ;
93
+ } else if ( options . url . indexOf ( "_=" ) === - 1 ) {
94
+ options . url += "&" + cacheBuster ;
96
95
} else {
97
- options . url . replace ( / & _ = \d + / , cacheBuster ) ;
96
+ options . url . replace ( / _ = \d + / , cacheBuster ) ;
98
97
}
99
98
request . open ( options . type , options . url ) ;
100
99
request . setRequestHeader ( 'content-type' , options . contentType ) ;
Original file line number Diff line number Diff line change @@ -81,15 +81,13 @@ const ajax = function(options) {
81
81
} ;
82
82
83
83
request . withCredentials = options . xhrFields . withCredentials ;
84
- var cacheBuster = "& _=" + new Date ( ) . getTime ( ) ;
84
+ var cacheBuster = "_=" + new Date ( ) . getTime ( ) ;
85
85
if ( options . url . indexOf ( "?" ) === - 1 ) {
86
- options . url += "?" ;
87
- }
88
- if ( options . url . indexOf ( "&_=" ) === - 1 ) {
89
- options . url += cacheBuster ;
90
- }
91
- else {
92
- options . url . replace ( / & _ = \d + / , cacheBuster ) ;
86
+ options . url += "?" + cacheBuster ;
87
+ } else if ( options . url . indexOf ( "_=" ) === - 1 ) {
88
+ options . url += "&" + cacheBuster ;
89
+ } else {
90
+ options . url . replace ( / _ = \d + / , cacheBuster ) ;
93
91
}
94
92
request . open ( options . type , options . url ) ;
95
93
request . setRequestHeader ( 'content-type' , options . contentType ) ;
You can’t perform that action at this time.
0 commit comments