HTML5 [removed] declarations

后端 未结 3 478
滥情空心
滥情空心 2020-12-06 09:55

Is it still necessary (or even good practice) when using HTML5 to declare the script type when using a script block?

e.g.

3条回答
  •  無奈伤痛
    2020-12-06 10:39

    The CDATA comments are for XML, so only applicable if you're serving your pages up as xml (which you shouldn't be if it's HTML5).

    As for the type attribute, it's optional now in HTML5.

提交回复
热议问题