Skip to content

Clear params in URL address  #20

@redbee2021

Description

@redbee2021

Turbolinks.visit(window.location.href.substr(0, window.location.href.indexOf('#')))
or
Turbolinks.visit(window.location.href.split('#')[0])

https://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-url-with-javascript-without-page-r
https://www.sqlpac.com/en/documents/javascript-listing-active-event-listeners.html
or
history.replaceState(null, null, ' ');
history.pushState(null, null, ' ')
history.replaceState({}, document.title, "."); // replace / with . to keep url
history.replaceState({}, document.title, location.href.substr(0, location.href.length-location.hash.length))

if(window.history.pushState) {
window.history.pushState('', '/', window.location.pathname)
} else {
window.location.hash = '';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions