jQuery - plugins not working

Posted by Community Admin on 03-Aug-2018 16:25

jQuery - plugins not working

All Replies

Posted by Community Admin on 09-Apr-2012 00:00

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

Posted by Community Admin on 09-Apr-2012 00:00

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>

Posted by Community Admin on 09-Apr-2012 00:00

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

Posted by Community Admin on 09-Apr-2012 00:00

<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

Posted by Community Admin on 09-Apr-2012 00:00

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>

Posted by Community Admin on 09-Apr-2012 00:00

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" />


Posted by Community Admin on 09-Apr-2012 00:00

I don't see jquery being loaded

Posted by Community Admin on 09-Apr-2012 00:00

I think it comes down in one of the ScriptResource.axd files (attached)

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



Posted by Community Admin on 09-Apr-2012 00:00

The JavaScriptEmbedControl did the trick. Thanks again Steve!! You're a lifesaver on this forum. I really appreciate your help.

Posted by Community Admin on 09-Apr-2012 00:00

Whew, great :)

I'd appreciate a "Marked as Answered" on the thread if possible :D

Posted by Community Admin on 25-May-2012 00:00

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"%>

This thread is closed