// Helper Method Defined Here.
(function (helper, $) {
// This is now a utility function to "Get the Document Hash"
helper.getDocumentHash = function (urlString) {
var hashValue = "";
if (urlString.indexOf('#') != -1) {
hashValue = urlString.substring(parseInt(urlString.indexOf('#')) + 1);
}
return hashValue;
};
})(this.helper = this.helper || {}, jQuery);
Ответ 7
У меня был URL-адрес от времени выполнения, ниже приведен правильный ответ:
let url = "www.site.com/index.php#hello";
alert(url.split('#')[1]);