Merge pull request #12 from s-m/cachebuster-fix

FIX: The cachebuster now only includes a questionmark, if there is none in the current url
This commit is contained in:
Thierry François 2013-02-02 08:18:46 -08:00
commit 878f9b1862
1 changed files with 9 additions and 2 deletions

View File

@ -127,8 +127,11 @@
});
data.records = ids;
if ( url.indexOf('?') !== -1 ) cacheBuster = '&cacheBuster=' + cacheBuster;
else cacheBuster = '?cacheBuster=' + cacheBuster;
$.ajax({
url: url + '/' + action + '?cacheBuster=' + cacheBuster,
url: url + '/' + action + cacheBuster,
data: data,
type: "POST",
context: $(this)
@ -183,8 +186,12 @@
$(formsWithUpadtes).each(function(){
cacheBuster = new Date().getTime() + '_' + $(this).attr('name');
data = $(this).serialize();
if ( url.indexOf('?') !== -1 ) cacheBuster = '&cacheBuster=' + cacheBuster;
else cacheBuster = '?cacheBuster=' + cacheBuster;
$.ajax({
url: url + '?cacheBuster=' + cacheBuster,
url: url + '/' + action + cacheBuster,
data: data,
type: "POST",
context: $(this)