Skip to content

Instantly share code, notes, and snippets.

@heathcliff
heathcliff / getHashParam.js
Last active September 16, 2023 14:54
getHashParam(), updateHashParam(), getParam()
function getHashParam(name) {
var regex = new RegExp("(#)("+name+")(\=)([^#]*)"),
matches = [];
matches = regex.exec(window.location.hash);
if (matches !== null && matches.length > 4 && matches[4] !== null) {
return matches[4];
} else {
return false;
}
}