+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / How to load jQuery plugins AFTER Sitefinity's auto-included jQuery.

How to load jQuery plugins AFTER Sitefinity's auto-included jQuery.

2 posts, 0 answered
  1. Edmund
    Edmund avatar
    4 posts
    Registered:
    22 Jul 2013
    12 Aug 2013
    Link to this post
    Sitefinity appears to always include its own version of jQuery on our pages, but I cannot seem to get our custom plugins to load AFTER this automatic jQuery include when working with a masterpage.  

    We have tried the following methods

    <sfc:JavaScriptEmbedControl ID="JavaScriptEmbedControl4" runat="server" ScriptEmbedPosition="InPlace" Url="~/JS/jPanel/lib/jquery.jpanelmenu.js"></sfc:JavaScriptEmbedControl>

    <sf:ResourceLinks ID="ResourceLinks1" runat="server">
        <sf:ResourceFile Name="~/JS/jPanel/lib/jquery.jpanelmenu.js" />   
    </sf:ResourceLinks>

     <script src="/JS/jPanel/lib/jquery.jpanelmenu.js"></script>

    as well as programmatically adding it on page init:

    if (!Page.IsBackend())
     {
    if (!Page.ClientScript.IsStartupScriptRegistered("jpanelmenuJS"))

                {

                    Page.ClientScript.RegisterClientScriptInclude("jpanelmenuJS", ResolveUrl("~/JS/jPanel/lib/jquery.jpanelmenu.js"));

                }
    }

    In each case, our Javascript files are included in the page, but before Sitefinity's version of jQuery loads.  We need to be able to include javascript files on our masterpages and they need to load AFTER jQuery.  Is there some sort of "load order" we can force these into?
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    30 Nov 2016
    15 Aug 2013
    Link to this post
    Hello,

    Sitefinity loads its jquery version on a frontend page when there is a user currently logged into the site, this query is not loaded when there is no authenticated user who have permissions to use inline editing for pages (the gear icon in the right side of the screen when viewing sitefinity page).
    Check pages for loaded jquery when there is no authenticated backend user logged in the current browser or disable the inline editing functionality from Administration->Settings->Advanced->Pages locate the texbox labeled Enable in-line editing and set it to False, save changes after this.
    For the best approaches loading jquery on the page refer to this blog post.

    Regards,
    Stanislav Velikov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered