Support Article
System hung up if we call external site Java Script file
SA-98083
Summary
On invoking an external JavaScript file to enable the DNS or cookie settings, the system refreshes the screen and hangs. As a result, and unable to perform any user action. The Script is included in the UserWorkForm and common Footer section.
Error Messages
Not Applicable
Steps to Reproduce
- Include the below third-party script in the UserWorkForm.
<script src="https://####.js" type="text/javascript" charset="UTF-8" ></script>
- Create a label and paste the below script on the label.
<button id="ot-sdk-btn" class="ot-sdk-show-settings">Do Not Sell My personal Information</button>
- Click the button at runtime.
Root Cause
An issue in the custom application code or rules.
A button was configured to display the third-party script's popup. In Pega, for every button element, Pega assigned a Listener by default and submitted the page on click of the button. In this usecase, on click of the label, the popup for the third-party displayed first and then the page is submitted. As a result, the screen reload occurred.
Resolution
Perform the following local-change:
Use a DIV element in the label, instead of a button.
Published December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.