How do I redirect page using Javascript to page.php#sample
<p>I want refresh page using javascript and go to div id.</p>

<p>Example what I have done is</p>

<pre><code>echo "&lt;script type='text/javascript'&gt;top.location.href = '" . $url . "/page.php#contact';&lt;/script&gt;";    
</code></pre>

<p>Example the <code>#contact</code> div is on half of page and it's not working, unless I hit the enter button and it goes to the <code>#contact</code>.</p>

<pre><code>&lt;div id="contact"&gt;Contact&lt;/div&gt;
</code></pre>

<p>If with php can be done</p>

<pre><code>header('Location:/page.php#contact');
</code></pre>

<p>Let me know the correct way to do this</p>
