Remove Hash when reloading page?

2019-07-05 13:46发布

问题:

Im using a hash to switch through my image slider. when i reload the page and the hash is set to e.h. #3 there is no picture. when the gallery slides automatically after some seconds it shows the next one... so for a few seconds there is nothing.

is there a way to check for a hash when loading the page and remove it? i just want to care about the persons who bookmark the page with the hash.

Greetings.

edited: hashtag --> hash (thank you.)

回答1:

location.hash = ""

Run that on page load.