Here I wrote a parser, that stores all your parameters into an object:
let params = {};
let splittedUrl = window.location.href.split('#');
if (splittedUrl.length >= 1) {
splittedUrl[1].split('&').forEach(elm => {
if (elm != '') {
let spl = elm.split('-');
params[spl[0]] = (spl.length >= 2 ? spl[1] : true);
}
});
}
(This code will also let you add more parameters with an ampercent sign.)
Example (with the URL 'https://example.com/#foo-bar&tmp-qux'):
Object.keys(params).length // 2
params['foo'] // bar
params['tmp'] // qux
I know, you asked for jQuery, but I think pure JavaScript should also work :)