The CheckMarx security scanner says that the 4th line:
$j('#h{!category}').on('click', function(event) {
in the following script, causes an XSS vulnerability. Can someone explain the best way to fix it? or if it's a false positive, how can I rewrite the script so it does not happen?
<script type="text/javascript" charset="UTF-8">
$j = jQuery.noConflict();
$j(document).ready(function(){
$j('#h{!category}').on('click', function(event) {
$j('#s{!category}').toggle();
$j('#h{!category}').css("background-color","{!entity.CPHeader__c}");
$j('#lmenu').css("width","195px")
$j('#mainbodyout').css("left","220px")
});
$j('#lmenu').on('mouseout', function(event) {
$j('#s{!category}').hide();
});
$j('#s{!category}').on('mouseover', function(event) {
$j('#s{!category}').show();
});
});
</script>
Thanks!