A
A
Alexey2015-01-13 01:50:49
Hashing
Alexey, 2015-01-13 01:50:49

How to remove hash from url?

How does it work on Habré? habrahabr.ru/post/244911/#habracut

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
ycexa, 2015-01-13
@Nudnyj

Habr does this through history:

$(window).load(function() {
    var histAPI = !!(window.history && history.pushState);
    if (histAPI && (document.location.hash == "#habracut" || document.location.hash == "#comments")) {
        history.replaceState({}, document.title, document.location.pathname + document.location.search)
    }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question