I was trying to make a jQuery templates example work on a SharePoint web part.
开发者_StackOverflowI 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
精彩评论