window.location is very slow to go another page
<p>why does window.location take 3 -5 sec to go another page? 
I want to change the page immediately after confirm . </p>

<pre><code>&lt;script&gt;
       var a = confirm('Do you want to insert the device specifications now ؟');
       if(a)
       {
       var name = '&lt;?= $items_name ?&gt;';
       window.location = 'mobiles.php?name='+name;
       }else
       {
       return false;
       }
&lt;/script&gt;
</code></pre>

<p>It seems to me location.assign is faster</p>

<pre><code>&lt;script&gt; 
var a = confirm('Do you want to insert the device specifications now?');
if(a) {  
  var name = '&lt;?= $items_name ?&gt;'; 
  window.location.assign('mobiles.php?name='+name); 
}
else { 
    return false; 
} 
&lt;/script&gt; 
</code></pre>
