Reputation: 3463
I am using cakephp and trying to define this in the script of ctp file. The output is also coming right with it.
if(window.location.pathname="/users/register"){
$('body').css('position', 'relative');
$('#footer').css('bottom', '0px');
$('#footer').css('position', 'absolute');
}
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.
Upvotes: 0
Views: 196
Reputation: 33153
You're using =
instead of ==
.
In any case you should use CakePHP's functions to check for the controller/view combination instead of what you're doing now:
if( $this->params['controller'] == 'users' && $this->params['action'] == 'register' ) {
echo $this->Html->scriptBlock( "$('body).css('position', 'relative'); etc etc" );
}
Upvotes: 0
Reputation: 8458
use == (comparison) instead of = (assignment) :)
if(window.location.pathname=="/users/register"){
Upvotes: 4