开发者

Javascript: script reference with no children not working

I was trying to make a jQuery templates example work on a SharePoint web part.

开发者_StackOverflow

I narrowed my problem down to the following:

This WORKS:

<script type="text/javascript" src="/_layouts/ServerComponents/jquery-latest.min.js" ></script>
<script type="text/javascript" src="/_layouts/ServerComponents/jquery.tmpl.min.js" ></script>

but this DOESN'T:

<script type="text/javascript" src="/_layouts/ServerComponents/jquery-latest.min.js" />
<script type="text/javascript" src="/_layouts/ServerComponents/jquery.tmpl.min.js" />

Why? Thanks!


Because script is not a self-closing tag. You always need the closing tag.

See the specification:

Start tag: required, End tag: required

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜