Why the page continuously reloads after using window.location in the script
<p>I am using cakephp and trying to define this in the script of ctp file. The output is also coming right with it.</p>

<pre><code>if(window.location.pathname="/users/register"){
    $('body').css('position', 'relative');
    $('#footer').css('bottom', '0px');
    $('#footer').css('position', 'absolute');
}
</code></pre>

<p>But the problem is the page keeps on constant reloading automatically when the defined pathname is visited. Is there any way to stop reloading continuously. The usage of this is requierd for proper output.</p>
