jQuery if hash has an appended value -
simple logic here, don't know how can separate value hash returned window.location.hash. .split('=')[0], removing before instead of after it.
some potential hashes: /#work /#work=video1
i'd say:
var hash = window.location.hash, val = hash.split('=')[0]; if (val != ''){ stuff because there value i.e. once split, value } else { other stuff because there value i.e. once split, value nothing }
var hash = window.location.hash, val = hash.substr( hash.indexof('=') + 1 ); if(val.length) { // val // } else { // else }
Comments
Post a Comment