why history api pushstate stops working

58 views Asked by At

This is my code:

onclick home button=`history.pushState({}, "Home", "/home");`

onclick settings button=`history.pushState({}, "Settings", "/settings");`

Now, it works fine, script works fine, but, when i add/append in address bar anything for example t, it would be localhost/homet, history api immediately stops working, I mean it works maybe but when I click some button for example when I click on settings button, url stays like before localhost/homet nothing is changed. why? is it possible to change that? maybe to remove? replace? anything? i tried to find out wheres problem but i couldn't. thanks

0

There are 0 answers