var list =["<script></script>", "A", "B", "C"]
I got unexpected token ILLEGAL error here. Say, if I do want the script tag to be included, but just plain text, how can I format the list. Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are using an inline script1, then
</script>will terminate the script element in the middle of the array constructor (all the HTML is parsed before the text nodes in the element are passed to the JS engine,</script>gets no special treatment for being inside a JS string literal).Escape the
/:You could also move the script to an external file and
srcit.<script>element with the JS directly inside it as opposed to one with asrcattribute or an intrinsic event attribute likeonclick.