Skip to content

Instantly share code, notes, and snippets.

@AsianChris
Last active April 6, 2016 22:01
Show Gist options
  • Save AsianChris/2a58c5b093976eb014874fc936b95443 to your computer and use it in GitHub Desktop.
Save AsianChris/2a58c5b093976eb014874fc936b95443 to your computer and use it in GitHub Desktop.
javascript: (function() {
var url = window.location.href;
var key = '_escaped_fragment_';
var value = '';
url = updateQueryStringParameter(url, key, value);
window.location.href = url;
// http://stackoverflow.com/a/6021027
function updateQueryStringParameter(uri, key, value) {
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
return uri.replace(re, '$1' + key + "=" + value + '$2');
} else {
return uri + separator + key + "=" + value;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment