jqueryjquery-pluginssitefinitysitefinity-5

Sitefinity 3.7 > 5 migration. jQuery no longer working


Afternoon all,

I am currently in the process of migrating a .NET web site from Sitefinity 3.7 to a .NET web app in Sitefinity 5.0.

Migration went fine, barring the differences in api's, but now I'm finding that all my previously working jQuery has just packed up.

More specifically, when I try to run my site I get a lot of ".hoverIntent Is not a function", with this applying to quite a few functions!

Previously, I had a master page with the following:

<script src='<%#ResolveUrl("~/App_Master/Scripts/jquery-1.4.2.min.js")%>' type="text/javascript"></script>
<script src='<%#ResolveUrl("~/App_Master/Scripts/jquery.anythingslider.js")%>' type="text/javascript"></script>
<script src='<%#ResolveUrl("~/App_Master/Scripts/jquery.easing.1.2.js")%>' type="text/javascript"></script>
<script src='<%#ResolveUrl("~/App_Master/Scripts/jquery.hoverIntent.minified.js")%>'
    type="text/javascript"></script>
<script src='<%#ResolveUrl("~/App_Master/Scripts/jquery.uniform.js")%>' type="text/javascript"></script>
<script src='<%#ResolveUrl("~/App_Master/Scripts/equalcolumns.js")%>' type="text/javascript"></script>
<script src='<%#ResolveUrl("~/App_Master/Scripts/publicMegaMenu.js")%>' type="text/javascript"></script>
<script src='<%#ResolveUrl("~/App_Master/Scripts/script.js")%>' type="text/javascript"></script>

The libraries appear to be loading fine but, obviously, something is a miss as it appears to throw a wobbly when, previously, it worked like a dream.

Any ideas anyone?

Beers on me for the right answer : )

EDIT: Right, it is something to do with the SiteSearch on the master page.

Everything seems to work when I comment out

<%--  <asp:ContentPlaceHolder ID="SiteSearch" runat="server" />--%>

If that remains, it throws a mental.


Solution

  • When logged in, Sitefinity loads a version of jQuery and depending on when/where/how you're pulling in your own reference to it, you could be causing some conflicts.

    Removing the jQuery reference from the page and using something like what's below should help.

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

    Here's a little bit more information on using JavaScript libraries with Sitefinity.