I have somes links like this:
mywebsite.com/tutos.php?name=tuto_name#comments
mywebsite.com/tutos.php?name=tuto_name#download
My question: how to get the text after the #.
thanks.
I use the following as it not only grabs the hash value (without the hash itself (taking the 2nd part (array[1] of the split)), but also tests the undefined case as well which can cause problems in some cases.
var hashVal = window.location.hash.split("#")[1];
if( hashVal && hashVal != "undefined" ) {
//work it
}
window.location.hash- and no jQuery at all