I have a grails project with the UI mostly implemented in javascript(BackBone.js). Briefly speaking i have a gsp file that includes a javascript file. The events of the gsp page are handled by the handlers defined in the Javascript file.
Now i have some DOM XSS violations in the javascript file.
eg. cell1.innerHTML = '<div name="caCertFileName">' + item.fileName.substring(33) + '</div>';
Now i cannot understand how to use the encodeAsHTML / encodeAsJavascript funtions in the javascript file. I need a short example to figure this out.