Bug: location.replace not working as expected in Opera

Forums » Opera for Windows/Mac/Linux » Opera browser

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

13. May 2010, 11:50:43

mwilco

Posts: 30

Bug: location.replace not working as expected in Opera

When I call location.replace with the same url but with a new hash link attached the location is not replaced as expected, a new history entry is instead added.

It works as expected if it's a different page. In both cases it works as expected (i.e. no history added) in Firefox and IE8.

Here's a simple test case:
<html><body>
<script type="text/javascript">
function replaceLocation()
{
	var url = location.href + '#hashlink';
	location.replace( url );
}
</script>
<input type="button" onclick="replaceLocation()" value="Replace URL"/>
</body></html>


Does anyone know of a work around for this or whether it's a known bug? (I'm using WindowsXP Opera 10.53)

Thanks.

14. May 2010, 14:42:21

mwilco

Posts: 30

I've now added a bug for this. (DSK-299033)

2. July 2012, 09:37:27

tamil3758

Posts: 1

Any updates on this issue? I'm using opera 11.61 and the issue still seem to persist

Forums » Opera for Windows/Mac/Linux » Opera browser