This content originally appeared on DEV Community and was authored by Labnan
Lets say you have this string in a variable (case insensitive):
`etc etc etc<!-- etc etc<scRipT> etc`
This will break any html tag after it.
Or lets say you divided that into some variables:
const first = `etc etc etc <!--`;
const second = `anything`;
const third = `<script>`
This will also break the html page.
Therefore please carefully assign any string that contains
`<!--<script>`
or similar into a variable, if it is inside <script>
tag.
Feel free to ask any question related to this in the comments :)
This content originally appeared on DEV Community and was authored by Labnan

Labnan | Sciencx (2021-11-21T07:21:43+00:00) “`<!–<script>`” in <script> will break your front end. Retrieved from https://www.scien.cx/2021/11/21/script-in-script-will-break-your-front-end/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.