Save the value to sessionStorage. Once you use it, delete the value so it cannot be read on a manual refresh.
sessionStorage.setItem("scroll_position", "300");
sessionStorage.getItem("scroll_position"); // 300
sessionStorage.removeItem("scroll_position");
sessionStorage is really well-supported -- it'll will work fine for IE8+ any relevant version of the other browsers.
StackOverflow handles after-page-load scrolling by storing post id's in the URL hash. You could do that as well.
The url stackoverflow.com/...../21485393#21485393 has #21485393 which matches an anchor element <a name="21485393"></a>
It will automatically scroll to that element after the page loads.
You could do something like that as well.
http://your.url.com/page#300
Retrieve it with
window.location.hash
And remove it once you're done by
window.location.hash = ""