开发者

JavaScript src with empty tag works, with empty end doesn't [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Why don't self-closing script tags work?

I am using Spring web-mvc with F开发者_开发百科reemarker and JQuery. The following works fine (layout, positioning etc):

<script type="text/javascript" src="<@spring.url 'jquery.ui.core.js'/>"></script>

But this doesn't:

<script type="text/javascript" src="<@spring.url 'jquery.ui.core.js'/>"/>

What's going wrong?


Nothing is wrong, script tags just require the closing tags, they can't be self closed.

More discussion about it available on this thread: Why don't self-closing script tags work?


You can't close a script tag using '/>' you have to use the explicit '</script>' closing tag.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜