0

I have a hard to google question because I don't know the correct vocabulary. I'm using Impress.js to create a slideshow. When I navigate the slideshow, Impress automatically adds a # symbol and the name of the slide to the url.

So when I navigate to my page by typing

rootFolder/index.html 

into the browser, it automatically changes to

    rootFolder/index.html#/overview

and then when I move to the next slide it changes to

    rootFolder/index.html#/step-2

and so on.

This has become an annoying problem for development since I don't know how to refresh the page and start from the very beginning of the slideshow. If I click on the refresh button of the browser, it will still remember the hashtag and the step name in the url. So my question is this: Is there a way to refresh the page back to just index.html without the hashtag and the things that follow the hashtag? Or is my only option to keep clicking in the address bar to manually delete the added elements?

EDIT: While the old question you linked to is helpful because it provides some vocabulary, they are actually not trying to do what I want to do: I want to refresh my page and remove the # part, but in that question they are trying to remove the # part while avoiding a refresh. I'm also not trying to refresh programmatically but simply by clicking on the refresh button of the browser (to get new changes made to my source code to display).

user44109
  • 121
  • 6
  • Does this answer your question? [How to remove the hash from window.location (URL) with JavaScript without page refresh?](https://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-url-with-javascript-without-page-r) – MaxiGui Sep 02 '20 at 19:54
  • @MaxiGui While the question you linked is helpful because it provides some vocabulary, they are actually not trying to do what I want to do: I want to refresh my page and remove the # part, but in that question they are trying to remove the # part while avoiding a refresh. I'm also not trying to refresh programmatically but simply by clicking on the refresh button of the browser (to get new changes made to my source code to display). – user44109 Sep 02 '20 at 20:00
  • The refresh button in the browser does not change the URL (which includes the `#` fragment) - just how abused/confusing that would be! Perhaps adding a quick bookmark to the “home” URL, or adding an image/header that can be clicked to go back “home”, or.. – user2864740 Sep 02 '20 at 20:04
  • @user2864740 Am I stuck having to manually clear out the url every time I make a change to my source code and want to refresh the page? – user44109 Sep 02 '20 at 20:06
  • I’ve updated the previous comment with two methods that I might consider. It might also be possible to use/write a browser plugin or a script applied via such (eg. Script Money, Tapermonkey, Greasemonkey). – user2864740 Sep 02 '20 at 20:07
  • what about ? [Remove hash from url](https://stackoverflow.com/questions/4508574/remove-hash-from-url) – MaxiGui Sep 02 '20 at 20:11
  • @MaxiGui It's a good read, but they are trying to do things with javascript, but I would simply like to use the browser GUI to do a clean refresh if possible. – user44109 Sep 02 '20 at 20:23

0 Answers0