Need help in changing DOM manipulation technique in Client-side code

Manasa Reddy Li
Tera Contributor

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
 
})();
0 REPLIES 0