More in this section

Forums / Developing with Sitefinity / Problems getting jQuery scripts to work if only added to the master page

Problems getting jQuery scripts to work if only added to the master page

3 posts, 0 answered
  1. Jeff
    Jeff avatar
    118 posts
    Registered:
    08 Jul 2011
    02 May 2012
    Link to this post
    I have a custom widget control that uses jQuery. It only works if I add the jQuery lib to the master page AND to the user control. Adding it only in the master page OR the user control and it doesn't work. Also, it only works if I add the scripts using a JavascriptEmbedControl. If I add them using ResourceLinks, in both places OR in one or the other it never works.
    What's going on? Can someone clarify?

    Thanks
  2. Jeff
    Jeff avatar
    118 posts
    Registered:
    08 Jul 2011
    03 May 2012
    Link to this post
    Anyone?
  3. Brett Whittington
    Brett Whittington avatar
    89 posts
    Registered:
    10 Aug 2012
    01 Jun 2012
    Link to this post
    My first question is how are you including your javascript libraries to your sitefinity project.  I have not had the same issue you are describing using the following method on my master page.

    <asp:ScriptManager ID="ScriptManager" runat="server" LoadScriptsBeforeUI="true"  >
        <Scripts>
            <asp:ScriptReference  Path="~/Sitefinity/WebsiteTemplates/NiSource/App_Themes/Default/JavaScript/jquery-1.7.1.min.js" ScriptMode="Release" />
        </Scripts>
    </asp:ScriptManager>



    And then by doing the following on my user control:
    <asp:ScriptManagerProxy ID="test" runat="server">
    <Scripts>
        <asp:ScriptReference Path="~/Path/javascript.js" ScriptMode="Release" />
    </Scripts>
    </asp:ScriptManagerProxy>

     

     

     

     

3 posts, 0 answered