I want to reload a webpage to the same scroll position, using
document.location.reload();
Works like a charm in all browsers except Edge. Edge refreshes to the top of the page.
Sample code:
<html>
<head>
<style>
body { padding-top: 150%; }
</style>
<script>
function locationreload() {
document.location.reload();
}
</script>
</head>
<body>
<button onclick="locationreload()" >
Reload
</button>
</body>
How to fix it?