ScriptLink Control in SharePoint 2013

Script Link Control is used to register sources, such as scripts, on a page so that they can be requested when the page is rendered.
 
<SharePoint:ScriptLink ID="scriptLink1" runat="server" Name="MyScript.js" LoadAfterUI="true" OnDemand="false" />
 
In this example, It assumes that myscript.js is present in _layouts folder of 15 Hive Directory. This will be called ,when page is rendered.
 

LoadAfterUI” determines where the script reference will be rendered in the HTML document. False inserts the script into the HTML head. True inserts the script at the end of the HTML body.

OnDemand” true specifies that the script should be loaded on demand. False will render the following script code:
<script type="text/javascript">
// <![CDATA[
document.write('<script type="text/javascript" src="/_layouts/MyScript.js"></' + 'script>');
// ]]>
</script>
 
True will render the following script code
 
<script type="text/javascript">RegisterSod("MyScript.js", "\u002f_layouts\u002fmy_script.js");</script>