summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-03-24 20:24:44 +0100
committerPeter Wu <peter@lekensteyn.nl>2015-03-24 20:27:56 +0100
commitfb80af778aea1ff00d47e2ffb5d2950061ee5a42 (patch)
tree1d65dfb32404d5b16bef487db3607d1b37d9e4cb /js
parentc8990e0b03ca53ebf70c1306c9db3e3dbdeb737c (diff)
downloadsite-fb80af778aea1ff00d47e2ffb5d2950061ee5a42.tar.gz
Add cache buster when development is enabled
Diffstat (limited to 'js')
-rw-r--r--js/main.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/main.js b/js/main.js
index 34e0890..f3a59a4 100644
--- a/js/main.js
+++ b/js/main.js
@@ -3,6 +3,11 @@ define(function() {
var all_pages = 'home studying curriculum campus career'.split(' ');
+ var cacheBuster = '';
+ if (/dev/.test(location.search)) {
+ cacheBuster = '?t=' + (new Date()).getTime();
+ }
+
/* loads a page into view and execute scripts */
function loadContent(name, text) {
var contentElement = document.getElementById('content');
@@ -35,7 +40,7 @@ define(function() {
http.onload = function() {
loadContent(page, http.responseText);
};
- http.open('get', 'pages/' + page + '.html');
+ http.open('get', 'pages/' + page + '.html' + cacheBuster);
http.send(null);
return true;
}