When i try to do this:
if (window.location.hash) {
current_page = window.location.hash;
}
$(current_page).siblings('.page').css(display: 'none');
current_page would be e.g #hello, so i dont think removing the # is necessary, since i am using ID's to identify the element.
This is my error in chrome:
Uncaught SyntaxError: Unexpected token:
I don't get more than that.
I've read other questions on here about how to use variables in selectors, and it should work. I've also rewritten it twice to make sure there's no hidden characters.
Does anyone know what's wrong?
console.log(window.location.hash)