Hello @kartik,
For current window, you can use this:
var hash = window.location.hash.substr(1);
To get the hash value of the main window, use this:
var hash = window.top.location.hash.substr(1);
If you have a string with an URL/hash, the easiest method is:
var url = 'https://www.edureka.co/;
var hash = url.split('#').pop();
If you're using jQuery, use this:
var hash = $(location).attr('hash');
Hope it helps!!
Thank you!!