simple logic here, I don’t know how I can separate the value from a hash returned by window.location.hash. Something like .split('=')[0], but removing everything before it instead of everything after it.
Some potential hashes: /#work /#work=video1
I’d like to say:
var hash = window.location.hash,
val = hash.split('=')[0];
if (val != ''){
do some stuff because there IS a value
i.e. once split, the value is something
} else {
do some other stuff because there IS a value
i.e. once split, the value is nothing
}
1 Answer