You need to be logged in to post in the forums. If you do not have an account, please sign up first.
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.