Created
April 30, 2015 13:16
-
-
Save JavaScript-Packer/5efdf14ae811858172f2 to your computer and use it in GitHub Desktop.
Get complete hash of URL without substring, split/join or indexof
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(window.location.hash) { | |
| alert(window.location.hash.replace("#","")); | |
| //above we simply get rid of the first occurance of #, without global set, only first match dealt with | |
| } else { | |
| alert('no hash for you'); | |
| } | |
| //this is a WHAK.com script :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment