Javascript and W3C validity?

时光毁灭记忆、已成空白 提交于 2019-12-25 01:20:07

问题


I have the impression that the use of javascript often breaks W3C xhtml/css validity. 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)?


回答1:


If you wrap your javascript in a //<![CDATA[ tag it will validate

https://developer.mozilla.org/en/properly_using_css_and_javascript_in_xhtml_documents




回答2:


The answer of your question is yes. To avoid this read this link http://www.htmlhelp.com/tools/validator/problems.html#script



来源:https://stackoverflow.com/questions/5057427/javascript-and-w3c-validity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!