More in this section

Forums / Developing with Sitefinity / Jquery conflict when logged in

Jquery conflict when logged in

5 posts, 0 answered
  1. Ruth
    Ruth avatar
    25 posts
    Registered:
    17 May 2012
    18 Sep 2012
    Link to this post
    When logged into Sitefinity and on the front end of the site I get a jquery error. This appears to be due to the fact that Sitefinity automatically includes a version of jquery when I'm logged in. Is there anyway I can stop this?

    Did you not think this would cause issues as chances are a microsoft developer is going to use jquery as their preferred javascript library?
  2. Craig
    Craig avatar
    45 posts
    Registered:
    28 Sep 2008
    18 Sep 2012
    Link to this post
    Ruth,

    This has been a known issue with Sitefinity for a while.  My suggestion is to NOT include your own version of JQuery into you page template and instead add the following code just inside the <form> tag.

    <sf:ResourceLinks ID="MyResourceLinks" runat="server">
        <sf:ResourceFile JavaScriptLibrary="JQuery" />
    </sf:ResourceLinks>

    This will include JQuery into your site and NOT cause conflicts any more.  But, this still poses one down side.  This will NOT include JQuery into the HEAD of the web page but at the top of the body.  So any JQuery you end up using on the page will need to be down inside the body or  just before the ending BODY tag.  Hope this helps.

    Enjoy!
  3. Ruth
    Ruth avatar
    25 posts
    Registered:
    17 May 2012
    18 Sep 2012
    Link to this post
    Thanks for your response Craig.

    I've just realised it's possible to disable inline editing, a by product of doing this is that jquery does not get included. I think I would prefer to do it this way as then we're not tied to the older version of jquery and that way the scripts can remain in the head.
  4. Craig
    Craig avatar
    45 posts
    Registered:
    28 Sep 2008
    18 Sep 2012
    Link to this post
    Ruth,

    I am curious how you were able to disable the inline editing.  This could be helpful for some stuff I am also working on.  Thanks.


    Craig
  5. Ruth
    Ruth avatar
    25 posts
    Registered:
    17 May 2012
    18 Sep 2012
    Link to this post
    Craig - go into the backend and then Settings>Advanced>Pages, scroll down to "Enable in-line editing" and set it to false.
5 posts, 0 answered