jQuery Plugins and/or authoring custom jQuery functions not

Posted by Community Admin on 04-Aug-2018 18:23

jQuery Plugins and/or authoring custom jQuery functions not working

All Replies

Posted by Community Admin on 27-Sep-2012 00:00

I'm trying to use some JQuery Plugins and add custom jQuery functions. These just don't seem to work no matter what method I try.

I've tried putting them in as ResourceLinks:
First placing <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %> just below <%@ Master Language="C#" %> 

and then placing

<sf:ResourceLinks ID="resourcesLinks" runat="server">
     <sf:ResourceFile JavaScriptLibrary="JQuery" />
     <sf:ResourceFile Name="~/Sitefinity/WebsiteTemplates/Library/App_Themes/Library/Global/Scripts/jquery-ui-1.8.23.min.js" Static="True" />
     <sf:ResourceFile Name="~/Sitefinity/WebsiteTemplates/Library/App_Themes/Library/Global/Scripts/showHide.js" Static="True" />
</sf:ResourceLinks>

in between the head tags and also just before the closing form tag at the bottom of the masterpage.

I've tried the JavaScriptEmbed Control method
placing <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<%@ Register TagPrefix="sitefinity" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls"%>
just after <%@ Master Language="C#" %> 

and then 

<sf:ResourceLinks ID="resourcesLinks" runat="server">
             <sf:ResourceFile JavaScriptLibrary="JQuery" />
        </sf:ResourceLinks>
in between the head tags, directly followed by
<sitefinity:JavaScriptEmbedControl ID="script1" runat="server" ScriptEmbedPosition="BeforeBodyEndTag" Url="~/Sitefinity/WebsiteTemplates/Library/App_Themes/Library/Global/Scripts/jquery-ui-1.8.23.min.js" />
       <sitefinity:JavaScriptEmbedControl ID="script2" runat="server" ScriptEmbedPosition="BeforeBodyEndTag" Url="~/Sitefinity/WebsiteTemplates/Library/App_Themes/Library/Global/Scripts/showHide.js" />

I've tried including jQuery in the ScriptManager
<asp:ScriptManager ID="ScriptManager" runat="server" LoadScriptsBeforeUI="true"  >
    <Scripts>
        <asp:ScriptReference  Path="~/Sitefinity/WebsiteTemplates/Library/App_Themes/Library/Global/Scripts/jquery-1.8.2.min.js" ScriptMode="Release" />
    </Scripts>
</asp:ScriptManager>
and then loading the other plugins as ResourceLinks at the bottom of the page just before the closing form tag.

I've tried loading them through them in javascript widgets -- pasting in the code directly and then tried placing them in all the different locations (in the head tag, where the widget is dropped, before the closing body tag) on the page, also trying the 'link to a javascript file' where you browse to pick the file -- even though i'm picking it directly it isn't even finding the file.

Plugins just don't seem to work. What is the process for integrating plugins? 
 Is there a walkthrough or something? I thought adding plugins would be a simple thing. Apparently its not.

Thanks for you help!

Posted by Community Admin on 28-Sep-2012 00:00

Worked with the JavaScriptEmbed Control method

Posted by Community Admin on 15-Oct-2012 00:00

Richard,
I am having the same issue you had with the jQuery functions not working.  I have tried using the Resource Links tags with both the jQuery library file and the specific one.  I have also tried your example with the JavaScriptEmbedControls and these don't work either.  I have also tried just script tags to embed the files, but still nothing seems to work.  

I have also made sure my master page file hasn't duplicated any of the same references.   Can you give me an example with code that worked? 

Posted by Community Admin on 15-Oct-2012 00:00

This is one of those persistent things which I FEEL like will never be officially addressed, and it's so amazingly frustrating.

I had this happen yesterday...firebug shows jquery and kendo loading at the top of the page.  My script was loading at the bottom of the page.  Firebug validates all of this, and yet nothing but kendo is undefined errors.  If I yank it out to a .html page or a standard aspx page, all works fine....in SF though, it's like pulling teeth.

Posted by Community Admin on 26-Oct-2012 00:00

Hey Caleb sorry I hadn't seen your post. The code I put in is exactly what I'd explained above. Though now I'm trying to integrate some Google Map Plugin scripts and they aren't working though when I put them in a Coldfusion page they load fine...go figure.

I'm still looking for a reliable way to use Javascript plugins. Does anyone have a fool proof way to do this?

Posted by Community Admin on 29-Oct-2012 00:00

Hey Richard,

If you can/want drop me an email ( jbokkers [at] live [dot] nl ) and I'll try and help you out with getting Jquery and the custom plugins working properly together...

Jochem

This thread is closed