HTML comments inside script problem
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘HTML comments inside script problem’ is closed to new replies.
The topic ‘HTML comments inside script problem’ is closed to new replies.
(@felipon)
6 years, 10 months ago
The following code is from a theme I bought, which has a wrong html comment of the type <– –> inside a tag script:
<script>
<!–pass images–>
var theme_directory = “”;
…rest of code
</script>
chrome ignores this comment and does not report it as an error.
but when autoptimize removes the HTML comments within the <script></script> tags, the following error is generated:
Uncaught SyntaxError: Unexpected identifier
<script>
pass images–>
var theme_directory = “”;
…rest of code
</script>
Is it correct, that autooptimize within the scope of a script removes code independent of whether it is badly coded? should not leave intact the code that goes inside the tag <script></script>, because that code is interpreted by the JS engine and not by the explorer’s graphic part.
Thank you.