More in this section
Forums / Developing with Sitefinity / Javascript not loading whilst using sf:ResourceFile

Javascript not loading whilst using sf:ResourceFile

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Andy
    Andy avatar
    5 posts
    26 Nov 2013
    17 Jun 2015
    Link to this post

    I have created a template with a Javascript 'hero slider' on a master page, not it's intended use but for testing it's fine.

    I have tested this outside of the Sitefinity environment and works exactly as I want it to. Now the problem is when I try and load it with a sf:ResourceFile it won't even place the link in the head, now I'm not the best developer in the world (I'm actually a designer) and I guess I'm doing something wrong and could do with a few pointers, I have attached the head code below. If needed I will attach screens, but the site is currently on a private server and can't be accessed.

     <%@ Master Language="C#" %>
    <%@ Register Namespace="Telerik.Sitefinity.Web.UI.NavigationControls" Assembly="Telerik.Sitefinity" TagPrefix="sf" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>

    <!DOCTYPE html>
        <head id="Head1" runat="server">
            <title>Objective IT | Turning vision into success</title>
            <meta http-equiv="content-type" content="text/html; charset=utf-8" />
            <meta name="viewport" content="width=device-width, user-scalable=no" />
            <%-- Application Icons --%>
            <meta name="application-name" content="Objective IT"/>
            <meta name="msapplication-TileColor" content="#ff5500"/>
            <meta name="msapplication-square70x70logo" content="tiny.png"/>
            <meta name="msapplication-square150x150logo" content="square.png"/>
            <meta name="msapplication-wide310x150logo" content="wide.png"/>
            <meta name="msapplication-square310x310logo" content="large.png"/>
            <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" />
            <link rel="apple-touch-icon" href="images/apple-touch-icon.png" />

            <link rel="next" href="/next"/>
            <link rel="prev" href="/prev"/>

            <script type="text/javascript" src=""></script>
            <script type="text/javascript">stLight.options({ publisher: "3e0f7867-d3b1-4a55-970f-5f4fa9ea8a15", doNotHash: true, doNotCopy: true, hashAddressBar: false });</script>

            <sf:ResourceLinks ID="ResourceLinks1" runat="server" UseEmbeddedThemes="false"> 
                <sf:ResourceFile Name="~/Sitefinity/WebsiteTemplates/Template1/App_Themes/ObjectiveTheme/Global/Reset.css" Static="true" />
                <sf:ResourceFile Name="~/Sitefinity/WebsiteTemplates/Template1/App_Themes/ObjectiveTheme/Global/Layout.css" Static="true" />
                <sf:ResourceFile Name="~/Sitefinity/WebsiteTemplates/Template1/App_Themes/ObjectiveTheme/Global/font-awesome.min.css" Static="true" />
                <sf:ResourceFile Name="~/Sitefinity/WebsiteTemplates/Template1/App_Themes/ObjectiveTheme/Global/objective.css" Static="true" />
                <sf:ResourceFile Name="~/Sitefinity/WebsiteTemplates/Template1/App_Themes/ObjectiveTheme/Global/print.css" Static="true" />
                <sf:ResourceFile JavaScriptLibrary="JQuery" />
                <sf:ResourceFile Name="~/Sitefinity/WebsiteTemplates/Template1/App_Themes/ObjectiveTheme/Global/js/scripts.js" Static="true" />
            <%--<script type="text/javascript" src=""></script>--%>

     If this makes no sense I apologise now as it's been a long day of staring at the same thing.

    Also one more thing, if I have the file in the normal html way it works in Chrome but nothing else, odd no?

1 posts, 0 answered