Use SGML CDATA section for generated JavaScript code to make validator.w3.org happy

Output from validator.w3.org:
Validation Output: 2 Errors

 Line 123, Column 36: character "&" is the first character of a delimiter but occurred as data
    "NAMEFILTER": "[\s\*?~^\$@%`\"'&;|<>\[\]#\x00-\x1f]"
✉
This message may appear in several cases:

You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
Another possibility is that you forgot to close quotes in a previous tag.
 Line 123, Column 39: character "<" is the first character of a delimiter but occurred as data
    "NAMEFILTER": "[\s\*?~^\$@%`\"'&;|<>\[\]#\x00-\x1f]"
✉
This message may appear in several cases:

You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
Another possibility is that you forgot to close quotes in a previous tag.
 Line 123, Column 36: xmlParseEntityRef: no name
    "NAMEFILTER": "[\s\*?~^\$@%`\"'&;|<>\[\]#\x00-\x1f]"
✉
 Line 123, Column 39: StartTag: invalid element name
    "NAMEFILTER": "[\s\*?~^\$@%`\"'&;|<>\[\]#\x00-\x1f]"