微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html – Internet Explorer – 注释结束警告中的意外字符

Internet Explorer抱怨评论中的url中有两个破折号:

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

HTML1416: Unexpected character in comment end. Expected “–>”.

如何摆脱这个荒谬的错误信息?

解决方法

the HTML 5 specification开始:

Comments must start with the four character sequence U+003C LESS-THAN SIGN,U+0021 EXCLAMATION MARK,U+002D HYPHEN-MINUS,U+002D HYPHEN-MINUS (<!--). Following this sequence,the comment may have text,with the additional restriction that the text must not start with a single “>” (U+003E) character,nor start with a U+002D HYPHEN-MINUS character (-) followed by a “>” (U+003E) character,nor contain two consecutive U+002D HYPHEN-MINUS characters (--),nor end with a U+002D HYPHEN-MINUS character (-). Finally,the comment must be ended by the three character sequence U+002D HYPHEN-MINUS,U+003E GREATER-THAN SIGN (-->).

摆脱错误信息.停止犯错误.在注释中用 – 重写代码的一部分.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐