I know I can get the hash value directly with this bit of code:
var hash = window.location.hash;
But is there anyway I can get the everything before the hash value directly as well?
Thank you!
Edit Using the Answer bellow: I am guessing the best way is..
var pageAddress = window.location.split('#')[0];
You can implement a Hash Table in JavaScript in three steps: Create a HashTable class with table and size initial properties. Add a hash() function to transform keys into indices. Add the set() and get() methods for adding and retrieving key/value pairs from the table.
The task is to check whether an URL contains or not. This can be done by using the Location hash property in JavaScript. It returns the string which represents the anchor part of a URL including the hash '#' sign.
I use:
window.location.href.replace(window.location.hash, '');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With