English 中文(简体)
Trouble with jQuery/jQuery UI and Sitefinity 4.0
原标题:

I am trying to use jQuery.hide("#whatever .class").hide("slide", { direction: "right" }, 750); to slide previously hidden divs in and out (think scrolling portals)... In just a basic HTML template it works fine. When I turn this into a Sitefinity master template it seems to be clashing with a built in version of jQuery and using $.noConflict(); does not seem to be helping. The error I m getting is:

Error: c.easing[this.options.specialEasing && this.options.specialEasing[this.prop] || a] is not a function
Source File: http://localhost/Sf4/ScriptResource.axd?d=OA8H8dIKI9jNRfyUWi_J-1dnW6KOX2OUR5SdpCRyXm_z1b9rEU86tS8njjEZ9-Nr0A8c_jz50CI8odnGSlRAImvVnFIjTj-xE7VHrDCn7icWqBV98QgezjOTu21wu6_-0&t=ffffffff82d3fa2f
Line: 556

every time it tries to slide. It appears that the auto generated Telerik code is overriding the jQuery UI JS file I ve imported. I ve even tried putting my JS file includes in the HTML <body> tag to make sure they come last- still no luck.

问题回答

I agree with others that utilizing Sitefinity s built-in JQuery library is preferred.

--

Regarding how to reference that built-in jQuery library, this is how it s done with Sitefinity 4.x:

<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<sf:ResourceLinks ID="resourcesLinks" runat="server">
    <sf:ResourceFile JavaScript Library="JQuery" />
</sf:ResourceLinks>

The official documentation on this topic can be found below:

Could you not try to use the Sitefinity jQuery instead?

To include the jQuery of theirs into a page you use:

<sitefinity:ResourceLinks id="resourcesLinks" runat="server">
<sitefinity:ResourceFile JavaScriptLibrary="JQuery"></sitefinity:ResourceFile>

jQuery UI should in theory be compatible with this as long as you also include it using a ResourceFile -

<sitefinity:ResourceFile Name="PathToJQueryUI/jqueryui.js" />

The order it is declared should be how it gets rendered...

I think the jQuery files loaded by telerik are not compatible with your jQuery version.

I think you can try 2 things:

  1. Adjust your jQuery file according to their version.
  2. Telerik has some feature where you can supply the javascript files with EnableEmbeddedResource="false".

FYI: I used telerik way back, so i don t actually remember much, but above points might help you.

<sitefinity:ResourceLinks id="resourcesLinks" runat="server">

<sitefinity:ResourceFile JavaScriptLibrary="JQuery"></sitefinity:ResourceFile>

where to include these two lines to add JQuery to a Sitefinity page





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签