Detectar un #hash en la URL
if(window.location.hash) { // Fragment exists alert(window.location.hash); } else { // Fragment doesn't exist }