The branch, master has been updated
via 73391c9e4205af7fb1571c12961f3ab9b1e8fa54 (commit)
from d2de55cb0b40c8c8d475f85f6318ec85e4b97701 (commit)
- Log -----------------------------------------------------------------
commit 73391c9e4205af7fb1571c12961f3ab9b1e8fa54
Author: ninadsp <ninadsp16289(a)gmail.com>
Date: Tue Aug 31 19:54:07 2010 +0530
Append a random number for all Ajax queries on these pages to prevent server side
caching from affecting the results
-----------------------------------------------------------------------
Summary of changes:
js/db_search.js | 10 ++++++++++
js/server_privileges.js | 16 ++++++++++++++--
js/sql.js | 9 +++++++++
js/tbl_select.js | 10 ++++++++++
4 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/js/db_search.js b/js/db_search.js
index 8a0474f..94fdf6c 100644
--- a/js/db_search.js
+++ b/js/db_search.js
@@ -16,6 +16,16 @@
$(document).ready(function() {
/**
+ * Set a parameter for all Ajax queries made on this page. Append a random
+ * number to tell server that each Ajax request is a new one
+ */
+ $.ajaxSetup({
+ data: {'random': function() {
+ return Math.random();
+ }}
+ });
+
+ /**
* Ajax Event handler for retrieving the result of an SQL Query
*
* @uses PMA_ajaxShowMessage()
diff --git a/js/server_privileges.js b/js/server_privileges.js
index e59ec62..dff2c65 100644
--- a/js/server_privileges.js
+++ b/js/server_privileges.js
@@ -159,7 +159,19 @@ function appendNewUser(new_user_string, new_user_initial,
new_user_initial_strin
$(document).ready(function() {
/** @lends jQuery */
-
+
+ /**
+ * Set a parameter for all Ajax queries made on this page. Some queries
+ * are affected by cache settings on the server side, and hence, show stale
+ * data. Append a random number to tell server that each Ajax request is a
+ * new one
+ */
+ $.ajaxSetup({
+ data: {'random': function() {
+ return Math.random();
+ }}
+ });
+
/**
* AJAX event handler for 'Add a New User'
*
@@ -445,7 +457,7 @@ $(document).ready(function() {
PMA_ajaxShowMessage();
- $.get($(this).attr('href'), {'ajax_request' : true,
'random': Math.random()}, function(data) {
+ $.get($(this).attr('href'), {'ajax_request' : true},
function(data) {
$("#usersForm")
.hide("medium")
.siblings("#initials_table")
diff --git a/js/sql.js b/js/sql.js
index a2000ac..76e6c40 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -107,6 +107,15 @@ function appendInlineAnchor(disp_mode) {
*/
$(document).ready(function() {
+ /**
+ * Set a parameter for all Ajax queries made on this page. Append a random
+ * number to tell server that each Ajax request is a new one
+ */
+ $.ajaxSetup({
+ data: {'random': function() {
+ return Math.random();
+ }}
+ });
/**
* current value of the direction in which the table is displayed
diff --git a/js/tbl_select.js b/js/tbl_select.js
index 88796bc..12072b0 100644
--- a/js/tbl_select.js
+++ b/js/tbl_select.js
@@ -14,6 +14,16 @@
$(document).ready(function() {
/**
+ * Set a parameter for all Ajax queries made on this page. Append a random
+ * number to tell server that each Ajax request is a new one
+ */
+ $.ajaxSetup({
+ data: {'random': function() {
+ return Math.random();
+ }}
+ });
+
+ /**
* Ajax event handler for Table Search
*
* @uses PMA_ajaxShowMessage()
hooks/post-receive
--
phpMyAdmin
Show replies by date