< SharePoint:ScriptLink language=”javascript” Defer=”true” runat=”server” Localizable=”true” Name=”code.js” />
That should do the trick within the masterpage! the custom javascript file Name=”code.js”
would be located at:
C:\Program Files\Common files\Microsoft Shared\Web Server
Extensions\15\Template\layouts\1033
to put it in a custom folder do Name=”/customFolder/code.js”
which equals:
< SharePoint:ScriptLink language=”javascript” Defer=”true” runat=”server” Localizable=”true” Name=”/customFolder/code.js” />
C:\Program Files\Common files\Microsoft Shared\Web Server
Extensions\15\Template\layouts\customFolder\code.js
if you set Localizable=”false”
is set to false that means it will take it from a custom folder within _layouts folder, if set to true it would be mapped to 1033 (english) folder!