Q:

javascript reload combined with scroll

I have the following javascript function; it works fine when I use the reload alone and works fine when I use the scroll alone; but it will not scroll when I combine the two together; I tried to change the sequence, but did not help; 
function myFunction() {
    window.open("http://www.example.com");
    location.reload(true);
    window.scrollBy(0,1000);
}

Thanks in advance for the help.

A:

You can set hash to somehash and then reload the page. After that, in your body onload, check the hash and if hash is somehash, scroll the page.
function myFunction() {
    window.open("http://www.example.com");
    location.hash = 'somehash';
    location.reload(true);
}

Add the following function to your page onload event handler.
function scrollOnload() {
    if (location.hash == 'somehash') {
        window.scrollBy(0,1000);
    }
}

