According to this post, we can reference the Sitefinity built-in script libraries and/or external script files in site master page as followed:

<sf:JsFileLink id="jsLink" runat="server" ScriptType="jQuery"></sf:JsFileLink>
<sf:JsFileLink id="jsLink" runat="server" ScriptType="prototype"></sf:JsFileLink>
<sf:JsFileLink id="jsLink" runat="server" ScriptType="mooTools"></sf:JsFileLink>

To use it, reference the assembly from the project and add the following code in the master page.

<%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Cms.Web.UI" TagPrefix="sf" %>

It didn’t mention which version of Sitefinity it’s used at but after testing, found out that it’s definitly not for our current 4.1 SP2 version. The “JsFileLink” property is for older version of the sitefinity 3.6 etc which comes from Telerik.Cms.Web.UI assembly.

Did a bit more digging around and got the right referencing for 4.1 version.

1. Add this to master page, immediately after Page tag.

<%@ Register TagPrefix="sf" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls"%>

2. Place the following inside the “form” tag, NOT in the “head” section.

If you have the “JS” folder location as mention in this structure, reference as followed:

<sf:JavaScriptEmbedControl runat="server" ID="jsLink1" ScriptEmbedPosition="Head" Url="~/Sitefinity/WebsiteTemplates/YourSiteTemplates/JS/test.js"></sf:JavaScriptEmbedControl>

If you have the script folder in your website root, use the following:

<sf:JavaScriptEmbedControl runat="server" ID="jsLink2" ScriptEmbedPosition="Head" Url="~/scripts/test.js"></sf:JavaScriptEmbedControl>

For built-in JQuery library, reference as followed:

<sf:JavaScriptEmbedControl runat="server" ID="jQyeryLink" ScriptEmbedPosition="Head" ScriptType="jQuery"></sf:JavaScriptEmbedControl>

3. Must have unique “ID” and specify “ScriptEmbedPosition” fields.

The JavaScriptEmbedControl will register a script in the selected ScriptEmbedPosition (Head, InPlace, BeforeBodyEndTag). This control is also available in the page editor in the Scripts and Styles toolbox section. You can add references to scripts when editing the page through the UI, and even write inline scripts by hand. ref

Place all the external JS link or code blocks at the end of the page rather than the “Head”. ie. use “BeforeBodyEndTag” for some reason sitefinity loads it’s own copy of jquery in the middle of the markup and it tends to mess up the rest of the scripts.

<sf:JavaScriptEmbedControl runat=”server” ID=”jQyeryLink” ScriptEmbedPosition=”BeforeBodyEndTag” Url=”~/scripts/jquery.min.js”></sf:JavaScriptEmbedControl>
<sf:JavaScriptEmbedControl runat=”server” ID=”JavaScriptEmbedControl1″ ScriptEmbedPosition=”BeforeBodyEndTag” Url=”~/scripts/jquery.cycle.all.js”></sf:JavaScriptEmbedControl>