10.24 2008-09-16 06:52 采纳率: 0%
浏览 371
已采纳

为什么自动关闭脚本标记不起作用?

What is the reason browsers do not correctly recognize:

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

Only this is recognized:

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

Does this break the concept of XHTML support?

Note: This statement is correct at least for all IE (6-8 beta 2).

转载于:https://stackoverflow.com/questions/69913/why-dont-self-closing-script-tags-work

  • 写回答

11条回答 默认 最新

  • ~Onlooker 2008-09-16 07:08
    关注

    XHTML 1 specification says:

    С.3. Element Minimization and Empty Element Content

    Given an empty instance of an element whose content model is not EMPTY (for example, an empty title or paragraph) do not use the minimized form (e.g. use <p> </p> and not <p />).

    XHTML DTD specifies script tags as:

    <!-- script statements, which may include CDATA sections -->
    <!ELEMENT script (#PCDATA)>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(10条)

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀