Internet Explorer - Unexpected character in warning end comment

Internet Explorer complains about two lines in the URL inside the comment :

<!-- <iframe src="/file.php?var=AQJ--dsf"></iframe> --> 

HTML1416: Unexpected character at the end of the comment. Expected "->".

How to get rid of this ridiculous error message?

+5
source share
2 answers

From the HTML 5 specification :

Comments must begin with the four-character sequence U + 003C LESS-THAN SIGN, U + 0021 EXCLUSIVE MARK, U + 002D HYPHEN-MINUS, U + 002D HYPHEN-MINUS ( <!-- ). After this sequence, a comment can have text with an additional restriction that the text should not start with one " > " (U + 003E) and not start with GIFE-MINUS U + 002D (-) after the " > " (U + 003E), and do not contain two consecutive characters U + 002D HYPHEN-MINUS ( -- ) , and do not end with the GIFEN-MINUS symbol U + 002D ( - ). Finally, the comment must be completed using the three-character sequence U + 002D HYPHEN-MINUS, U + 002D HYPHEN-MINUS, U + 003E MORE THAN A SIGN ( --> ).

To get rid of the error message. Stop making a mistake. Rewrite the piece of code with -- inside the comment.

+5
source

As indicated at wr.org

"A common mistake is to include hyphens in the comments (" --- "). Authors should avoid placing two or more adjacent hyphens inside comments."

Link here

0
source

All Articles