Please ensure your expression is correctly encoded or sanitized to Avoid HTML

Hi, can someone help me with this error in javascrip. An update of the version of version was made and this warning is generated.

thanks


SyntaxEditor Code Snippet

"
<script type=""text/javascript"">
$( document ).ready(function() {
    $('#" + MainContainerId + " :input').prop(""disabled"", true); // disable inputs
    $('#" + ActionsContainerId + " :input').prop(""disabled"", true); // disable inputs
});
</script>
"



Solution

Hi German,


Try using EncodeHTML() function:

"
<script type=""text/javascript"">
$( document ).ready(function() {
    $('#" + EncodeHTML(MainContainerId) + " :input').prop(""disabled"", true); // disable inputs
    $('#" + EncodeHTML(ActionsContainerId) + " :input').prop(""disabled"", true); // disable inputs
});
</script>
"


Best regards,


MP

Solution