Skip to content

Instantly share code, notes, and snippets.

@tamewhale
Last active December 13, 2015 22:29
Show Gist options
  • Save tamewhale/4984917 to your computer and use it in GitHub Desktop.
Save tamewhale/4984917 to your computer and use it in GitHub Desktop.
A bookmarklet for flushing pages in Silverstripe.
javascript:(function(){var l=window.location,q="?flush=1";l+="";if(-1!==l.indexOf("?")){q="&flush=1";if(-1!==l.indexOf("flush=1")){q="";}}window.location+=q;})();
(function () {
var q = window.location.search, n = "?flush=1";
// check if there is a query string
if (0 === q.length) {
n = "&flush=1";
// check if flush is already set
if (-1 !== q.indexOf("flush=1")) {
n = "";
}
}
window.location += n; // sets new window location
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment