自关闭脚本元素为何不起作用?

丶灬走出姿态 提交于 2020-10-26 03:57:03

问题:

What is the reason browsers do not correctly recognize: 浏览器无法正确识别的原因是什么:

<script src="foobar.js" /> <!-- self-closing script element -->

Only this is recognized: 只有这是公认的:

<script src="foobar.js"></script>

Does this break the concept of XHTML support? 这是否打破了XHTML支持的概念?

Note: This statement is correct at least for all IE (6-8 beta 2). 注意:此声明至少对所有IE(6-8 beta 2)都是正确的。


解决方案:

参考一: https://stackoom.com/question/IBd/自关闭脚本元素为何不起作用
参考二: https://oldbug.net/q/IBd/Why-don-t-self-closing-script-elements-work
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!