Content Security Policy
Startup Scripts, Script Modules, etc.
The Nonce Attribute
<script nonce="<?attr CspNonce ?>"> console.log("Hello"); </script>
<style nonce="<?attr CspNonce ?>"> .my-cool-element { border-radius: 5px; } </style>Inline Scripts
<button onclick="handler1()">Button 1</button>
<button onclick="handler2()">Button 2</button><button id="<?attr OutputId() ?>-btn1">Button 1</button>
<button id="<?attr OutputId() ?>-btn2">Button 2</button>
<? startupscript ?>
document
.getElementById(<?js OutputId() ?> + "-btn1")
.addEventListener("click", () => handler1());
document
.getElementById(<?js OutputId() ?> + "-btn2")
.addEventListener("click", () => handler2());
<? end ?>JavaScript in Href
Inline Styles
Script Evaluation
Last updated
Was this helpful?