Hi all, How do i generate javascript depending on a php variable, like jQuery(document).ready(function() { enableCarousel(); checkAgreed(); -->here php variable if true include this javascript -->end if }); Code (markup): regards,
solved by jQuery(document).ready(function() { enableCarousel(); checkAgreed(); <?php if(product() == true){ ob_start(); ?> here a bunch of javascript <?PHP $output = ob_get_contents(); ob_end_clean(); echo $output; }//endif ?> }); Code (markup): ps: was planning to use heredoc but it wouldn't work