开发者

Script tag in XHTML

开发者 https://www.devze.com 2022-12-27 23:42 出处:网络
This might sound like a reaaaally dumb question but... why do browsers have a fit with this syntax: <script type=\'text/javascript\' src=\"/path/to/my.js\" />

This might sound like a reaaaally dumb question but...

why do browsers have a fit with this syntax:

<script type='text/javascript' src="/path/to/my.js" />

and want this instead

<script type='开发者_StackOverflow中文版text/javascript' src="/path/to/my.js"></script>

Seems the first construct should be valid since there's no inner content to the tag..

?


Why don't self-closing script tags work?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号