var oldHash; function checkHash() { if (!oldHash) oldHash = window.location.hash; else if (window.btoa(oldHash) != window.btoa(window.location.hash)) { var newHash = window.location.hash.substring(1, window.location.hash.length); if(staticText['menu'][newHash]) { getContent(); } oldHash = window.location.hash; } setTimeout(checkHash, 200); }