I'm working on a legacy application built in jquery and PHP. I'm not sure how to assign the variable correctly. The PHP part is blank when a view source.
if(window.location.href.indexOd('age') >= 0){
<?php
$width = '750px'
?>
} else {
$width = '500px'
}
The width variable is then assigned using jquery
$('#main-dev').attr('style', max-width:<?php echo $width;?>");
This isn't apply the correct width.
Any ideas why the php variable isn't taking?
The JS above appears in the source like
if(window.location.href.indexOd('age') >= 0){
} else {
}
I've never used PHP before, just trying to work on this legacy site?