Able to do it for jsp and java files, doubt how to make use of xssAPI.encodeForJSString("") in some .js file in adobe cq5.6
This is to do with xss issue reported by fortify tool for below code in js file
window.location.href = window.location.href + ("?mode=view");