How to load jQuery plugins AFTER Sitefinity's auto-inclu

Posted by Community Admin on 04-Aug-2018 16:58

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

All Replies

Posted by Community Admin on 12-Aug-2013 00:00

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?

Posted by Community Admin on 15-Aug-2013 00:00

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

This thread is closed