I have my URL
www.site.com/product/link/codigo/1
After loading, I would like the URL to not appear in the browser, just www.site.com
How can I do this?
I have my URL
www.site.com/product/link/codigo/1
After loading, I would like the URL to not appear in the browser, just www.site.com
How can I do this?
This JavaScript command clears the URL by holding only the domain:
window.history.pushState("", "", "/");
It will be registered in the browsing history because this is what this command is really (we use this feature to include an Ajax request in the browsing history and to allow the URL sharing of a page with changed status via AJAX.)
Another way would be: instead of the user getting this page for a link, get for a POST
, then the POST response is a new page with redirect (the URL will remain the same ).
I do not know your specific need, so follow an opinion: a good web application always gives the user the experience of browsing between pages and through links. Even if the application is a wonderful single page such as GMail or something close to it like Facebook, the user will like to be able to browse the history, save bookmarks and share URLs. feature that I have described (return page through POST), the user has experience of impaired usage.