You can access the contents of the string after the hash in the URL with window.location.hash
.
You'll then need to so a little bit of parsing to get your key-value pairs. Something like the code below:
function getParameters(){
params = {}
var keyValuePairs = window.location.hash.substr(1).split('&');
for (x in keyValuePairs){
var split = keyValuePairs[x].split('=', 2);
params[split[0]] = (split[1]) ? decodeURI(split[1]) : "";
}
return params;
}
function setParameters(key, value){
var params = getParameters();
params[key] = value;
var hashString = ""
for (x in params){
if (params[x]){
hashString += "&" + x + "=" + encodeURI(params[x]);
} else {
hashString += "&" + x;
}
}
window.location.hash = hashString.substr(1);
}
You could read the read your "filter" parameter with something like:
var parameters = getParameters();
console.log(parameters.filter);