[英]Javascript and W3C validity?
I have the impression that the use of javascript often breaks W3C xhtml/css validity. 我的印象是,使用javascript通常会破坏W3C xhtml / css的有效性。 Is this true?
这是真的? If so, why and is there a way for me to use javascript in my webpages and still have them be W3C valid (html, xhtml, css)?
如果是这样,为什么并且有办法让我在我的网页中使用javascript并使它们仍然是W3C有效的(html,xhtml,css)?
The answer of your question is yes. 您的问题的答案是肯定的。 To avoid this read this link http://www.htmlhelp.com/tools/validator/problems.html#script
为避免这种情况,请阅读此链接http://www.htmlhelp.com/tools/validator/problems.html#script
If you wrap your javascript in a //<![CDATA[
tag it will validate 如果您将JavaScript包装在
//<![CDATA[
标签中,它将进行验证
https://developer.mozilla.org/en/properly_using_css_and_javascript_in_xhtml_documents https://developer.mozilla.org/zh-CN/properly_using_css_and_javascript_in_xhtml_documents
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.