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

Forums / General Discussions / jQuery - plugins not working

jQuery - plugins not working

11 posts, 1 answered
  1. Jeff
    Jeff avatar
    118 posts
    Registered:
    08 Jul 2011
    09 Apr 2012
    Link to this post
    There are several jQuery plugins that I need to use in my SF4.4 project but I can't seem to get any of them to work. For example, in my master page I'm trying to use a plugin that rounds the corners of divs. I've tried using the resource links control to add jquery and the link to the plugin but it doesn't work. I also have a cutom widget that I registered. In it I added a resource link to jQuery and a link to the plugin but it doesn't work either. When I make a call to the plugin I get an Object doesn't support property or method 'quicksand' error.

    Can someone tell me what I'm doing wrong?

    Thanks,
    Jeff
  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    09 Apr 2012
    Link to this post
    Hmmm, are you calling your plugins like this

    <script type="text/javascript">
      $("mydiv").quicksand();
    </script>

    Or like this
    <script type="text/javascript">
      $(document).ready(function(){
          $("mydiv").quicksand();
      });
    </script>
  3. Jeff
    Jeff avatar
    118 posts
    Registered:
    08 Jul 2011
    09 Apr 2012
    Link to this post
    Here's a link to my original post.

    http://www.sitefinity.com/devnet/forums/sitefinity/general-discussions/jquery-error-object-doesn-t-support-property-or-method-quicksand.aspx

    I calling the plugin according to their documentation.

    Thanks Steve
  4. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    09 Apr 2012
    Link to this post
    <script type="text/javascript">
        $(document).ready(function(){
            $('.button').click(function (e) {
                $('.all').quicksand($('.warm li'), {
                    duration: 3000,
                    attribute: 'id',
                    easing: 'easeInOutQuad'
                });
                e.preventDefault();
            });
        });
    </script>
    Try this

  5. Jeff
    Jeff avatar
    118 posts
    Registered:
    08 Jul 2011
    09 Apr 2012
    Link to this post
    Still not working. I have a hard coded link to the jquery lib in the master page that I thought might be causing the problem so I removed it. In the custom user control I have the following. On page load I get  'jQuery' is undefined. Then when I click the button I still get the original error.
    <sf:ResourceLinks ID="ResourceLinks1" runat="server">
        <sf:ResourceFile JavaScriptLibrary="JQuery" />
        <sf:ResourceFile Name="~/javascript/jquery.quicksand.1.2.js" />
        <sf:ResourceFile Name="~/javascript/jquery.easing.1.3.js" />
    </sf:ResourceLinks>
  6. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    09 Apr 2012
    Link to this post
    Open Firefox->Firebug and in the Net tab...are they loading in the proper order?  Like jQuery is coming first?

    Using this syntax, I'm reminded of a bug where tilde (~/) items came before the others

    So try this instead (see what happens)
    <sf:ResourceLinks ID="ResourceLinks1" runat="server">
        <sf:ResourceFile JavaScriptLibrary="JQuery" />
    </sf:ResourceLinks>
    <sitefinity:JavaScriptEmbedControl ID="script1" runat="server" ScriptEmbedPosition="InPlace" Url="~/javascript/jquery.quicksand.1.2.js" />
    <sitefinity:JavaScriptEmbedControl ID="script2" runat="server" ScriptEmbedPosition="InPlace" Url="~/javascript/jquery.easing.1.3.js" />


    Answered
  7. Jeff
    Jeff avatar
    118 posts
    Registered:
    08 Jul 2011
    09 Apr 2012
    Link to this post
    I don't see jquery being loaded
  8. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    09 Apr 2012
    Link to this post
    I think it comes down in one of the ScriptResource.axd files (attached)

    So try setting the ScriptEmbedPosition to "BeforeBodyEndTag" instead of "InPlace"



  9. Jeff
    Jeff avatar
    118 posts
    Registered:
    08 Jul 2011
    09 Apr 2012
    Link to this post
    The JavaScriptEmbedControl did the trick. Thanks again Steve!! You're a lifesaver on this forum. I really appreciate your help.
  10. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    09 Apr 2012
    Link to this post
    Whew, great :)

    I'd appreciate a "Marked as Answered" on the thread if possible :D
  11. Nick
    Nick avatar
    18 posts
    Registered:
    19 Jul 2012
    25 May 2012
    Link to this post
    Hi All,

    It may be helpful for anyone reading this to know that for the solution above to work, you should put the following at the top of your page in order for the "sf" and "sitefinity" shortcuts to work. This will setup the tag prefixes and give you access to the "Telerik.Sitefinity.Web.UI" and "Telerik.Sitefinity.Web.UI.PublicControls" assemblies.

    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
    <%@ Register TagPrefix="sitefinity" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls"%>

11 posts, 1 answered