PHP in Javascript
-
I am developing a Content Security Policy and implementing the use of none for my inline scripts. When I add php to my javascript to echo out the nonce value from my function/variable it renders the php as text and does not display the nonce value. How can I use php inside of javascript in this plugin?
<script nonce="<?php echo esc_attr($GLOBALS['csp_nonce']); ?>">
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘PHP in Javascript’ is closed to new replies.