Javascript Insertion in End of Survey | XM Community
Skip to main content

How do I add this code to my End of Survey?

 

function addPrintBlur() {
  const style = document.createElement('style');
  style.textContent = `
    @media print {
      body {
        filter: blur(10px); /* Adjust the blur intensity as needed */
      }
    }
  `;
  document.head.appendChild(style);
}

// Call the function to add the CSS rule
addPrintBlur();

You can add javascript inside a script tag in an addOnload function in your end of survey message.  However, it would be easier just to add the style tag to your end of survey message:

End of survey message text here.
<style>
@media print {
body { filter: blur(10px); }
}
</style>

 


Thank you for this information!!!


Leave a Reply