<?php // Define the PHP value in your code $js_user_acc = true; ?> <html> <head> <title>whatever</title> <!-- in the HTML output, set it as a Javascript literal value --> <script> var MyNamespace = { user_acc: <?= json_encode($js_user_acc) ?>, }; </script> </head> <body> <div>foo</div> </body> </html>
You have javascript disabled. You will not be able to edit any code.