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

Forums / Developing with Sitefinity / jQuery Plugins and/or authoring custom jQuery functions not working

jQuery Plugins and/or authoring custom jQuery functions not working

6 posts, 0 answered
  1. Richard
    Richard avatar
    64 posts
    Registered:
    09 Oct 2012
    27 Sep 2012
    Link to this post
    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!
  2. Richard
    Richard avatar
    64 posts
    Registered:
    09 Oct 2012
    28 Sep 2012
    Link to this post
    Worked with the JavaScriptEmbed Control method
  3. Caleb
    Caleb avatar
    10 posts
    Registered:
    15 Oct 2012
    15 Oct 2012
    Link to this post
    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? 
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    15 Oct 2012
    Link to this post
    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.
  5. Richard
    Richard avatar
    64 posts
    Registered:
    09 Oct 2012
    26 Oct 2012 in reply to Caleb
    Link to this post
    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?
  6. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    29 Oct 2012 in reply to Richard
    Link to this post
    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
6 posts, 0 answered