Answer the question
In order to leave comments, you need to log in
JS: Functionality of window.location.replace() for Opera?
In all browsers except Opera, window.location.replace() replaces the url perfectly without making a record in the browser's history (in my case, you need to change the hash, for example "#1").
Is there any way to change the url in opera without making an entry in the browser history?
The bottom line is that there is an image gallery, when switching between images, the hash changes (so that you can give someone a link, and the person got to the same picture that was opened when copying the address). If a visitor wanders through the gallery and clicks "back", then in all browsers, except for opera, he will be taken to the previous page, and in opera to the same page with the previous image. How to avoid it?
Answer the question
In order to leave comments, you need to log in
Yes, in Opera the window.location.replace method doesn't work as it should. If we change the url with a page reload, then everything is fine. For example:
visit site1.com
go site2.com
javascript: window.location.replace('?q=1')
go back // пользователь на site1.com
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question