Is this bad practice to use php statements such as 'if' within a jquery function?
should I really just be writing loads more functions instead of limiting a few using php? it seems to work fine but was wondering if this is a major faux pax?
example:
this is a code snippet, basically if the php variable $url is equal to 'projects' then the code will come back with extra lines, otherwise these will be hidden from other pages. Does this make sense?
timer = setTimeout(function() {
$('li#contact').removeClass('cur');
$('li#$url').addClass('cur');
"; if($url=='projects') { echo"
$('ul.projects').fadeIn('slow');
$('ul.image_display').css('display', 'block');"; }
echo"
}, 8625);