Reload page but don't scroll to top in IE
<p>Hi I have a big table of items to administrate. When I click buttons I use </p>

<pre><code>$.post("update_the_database.php", { mode: 'themode', username: username },
            function(result){
                window.location.href = window.location.href;
        });
</code></pre>

<p>This runs <code>"update_the_database.php"</code> in the background then when it is finished it reloads the page. It goes back to the top of the page though...</p>

<p>I've tried:</p>

<pre><code>window.location.href = window.location.href + '#the_id';
</code></pre>

<p>but in all browsers (IE, Firefox, Chrome, Safari) it changes the URL in the address bar but doesn't reload the page. </p>

<p>From here:</p>

<p><a href="http://stackoverflow.com/questions/2405117/difference-between-window-location-href-window-location-href-and-window-location">Difference between window.location.href=window.location.href and window.location.reload()</a></p>

<p>"window.location.href=window.location.href will not reload the page if there's an anchor (#) in the URL - You must use window.location.reload() in this case."</p>

<p>So I tried:</p>

<pre><code>window.location.reload(true);
</code></pre>

<p>and it reloads the page and scrolls down to the previous spot in Chrome and Safari but not IE and Firefox...</p>

<p><a href="http://stackoverflow.com/questions/1589799/how-to-force-a-page-to-reload-if-all-what-was-changed-in-url-is-hash">How to force a page to reload if all what was changed in url is hash?</a></p>

<p>Approach #2:</p>

<pre><code>window.location.hash = "#" + newhash;
window.location.reload(true);
</code></pre>

<p>Now it works in Firefox... </p>

<p>BTW if I use window.location.reload(true); in IE it comes up with:</p>

<pre><code>Windows Internet Explorer

To display the webpage again, the web browser needs to
resend the information you've previously submitted.

If you were making a purchase, you should click Cancel to
avoid a duplicate transaction. Otherwise, click Retry to display
the webpage again.

Retry   Cancel   
</code></pre>

<p>You have to press "Retry" otherwise it has an error page that says "Webpage has expired".</p>

<p>To avoid that IE popup I'm currently doing:</p>

<pre><code>                window.location.hash = "#&lt;?php echo $id;?&gt;";
                if (navigator.appName != 'Microsoft Internet Explorer') {
                    window.location.reload(true);
                }
</code></pre>

<p>Though it just puts the hash into the address bar and it doesn't refresh the page even if I go to the address bar and press enter. I have to remove the hash and press enter to reload the page... (then it scrolls to the top)</p>
