I know this is a frequent question on Stack Overflow but I couldn't find scenario where the PHP code is just above JS script in the same file. I guess ajax POST/GET won't do the job in this case?
(...)
var ww = $(window).width();
</script>
<?php $ww = [data here] ?>
See Question&Answers more detail:os