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

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -