Skip to main content
Nintex Community Menu Bar
Solved

JavaScript function not fire

  • Aug 15, 2022 9:53 AM UTC
  • 4 replies
  • 145 views
  • Translate All

Akhanjer
Forum|alt.badge.img+5

hello everyone, I'm trying to run a JavaScript function when click to the button as screenshot  ,

 

But nothing happens when I click to button .

 

 

25157i2284AF0A54992B96.png25158i594A85117C28F1E5.png

Best answer by ernie_hayter

Hi @Akhanjer ,

 

You will need to switch off Prevent XSS if you want to execute script - that setting will sanitise any JS script transferred to the Data Label.

 

HTH,

Ernie

View original

4 replies

ernie_hayter
Nintex Partner
Forum|alt.badge.img+6
  • Nintex Partner
  • Answer
  • Aug 15, 2022 9:57 AM UTC

Hi @Akhanjer ,

 

You will need to switch off Prevent XSS if you want to execute script - that setting will sanitise any JS script transferred to the Data Label.

 

HTH,

Ernie

Translate

Akhanjer
Forum|alt.badge.img+5
  • Author
  • Rookie
  • Aug 15, 2022 10:04 AM UTC

thank you it is work 🙂

Translate

ernie_hayter
Nintex Partner
Forum|alt.badge.img+6
  • Nintex Partner
  • Aug 15, 2022 10:11 AM UTC

Happy it works!

 

Just as a word of warning - you will need to use Prevent XSS setting on fields that load values that external parties can alter to prevent injection of potentially harmful JavaScript. Only use JS injection on fields that users can't change.

 

Cheers,

Ernie

Translate

NigelStratton
Forum|alt.badge.img+5
This will work the first time because "Execute JavaScript" fires it's Change event. If you send the same command again, Change is not fired and the Javascript isn't executed. You have to blank out "Execute JavaScript" before sending the script again.
Translate