Need help in changing DOM manipulation technique in Client-side code
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2023 10:46 AM
Hi all,
In the HealthScan findings, we found that Client side code should not follow DOM Manipulation technique.
Can someone please help with modifying the below UI script without DOM Manipulation?
UI Script:
(function() {
var top = document.querySelector('head'); // reach out to the parent window and get the head element
var script = document.createElement('script'); //create a new script element
script.setAttribute('src','https://c.evidon.com/dg/dg.js'); //sets the src attribute
script.setAttribute("companyId","2523");
top.appendChild(script); // appends the newly created script element at the end of the top window head element
})();
Labels:
- Labels:
-
Cost Management (ITSM)
0 REPLIES 0