More in this section

Forums / General Discussions / custom master page... how do I reference jquery and prototype?

custom master page... how do I reference jquery and prototype?

5 posts, 0 answered
  1. Paolo
    Paolo avatar
    147 posts
    Registered:
    11 Jun 2009
    13 May 2011
    Link to this post
    Hello,
    I'm creating my own custom master page and I wish to add jQuery support...how can I achieve this?
    Thanks

    Paolo
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    18 Sep 2017
    16 May 2011
    Link to this post
    Hello Paolo,

    Take a look at this KB article and this forum post that explains how to achieve it.

    Hope this information is helpful to you.

    Regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Rob
    Rob avatar
    20 posts
    Registered:
    03 Jun 2010
    03 Jun 2011
    Link to this post
    I'm trying to do the same thing.  I'm trying to call a jQuery library, and additional jQuery scripts.  I looked at your first link, and saw that it was posted in March of 2009.  I looked at the forum link, and I see it's posted in April of 2010.  This thread was created in May of 2011, so I'm guess those have to be out-dated.

    How do I hook up a jQuery library and separate jQuery files in 4.1?  Where do I need to place those files in the directory, and what's the code to hook them up?
  4. Rob
    Rob avatar
    20 posts
    Registered:
    03 Jun 2010
    06 Jun 2011
    Link to this post
    Nevermind, I found a work-around.  I could never call a jQuery script like I would through Google, or through Sitefinity.  However, I was able to link to one directly in the Scripts widget on the template. 

    Just a quick note, the link to Javascript file doesn't work.  You can link to a file, but the link is incorrect.  I had to correct the link manually.
  5. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    18 Sep 2017
    07 Jun 2011
    Link to this post
    Hi Rob,

    Happy to hear you have resolved the issue.

    In order to have jQuery included in your page use the following code:

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

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

    Please try to move the part with the script registration at the bottom of the master page - before the closing form tag. The ones that do not rely on jQuery can still be kept in the head.
    Keeping the scripts at the bottom will make the pages load faster from user's perspective. This "effect" is due to the fact that the while the browsers are loading scripts the others calls (images/css/etc) are being postponed.
    We currently don't have a way to place a reference to jQuery in the top of the page instead of the bottom. If you want some scripts in the head you can use JavaScript widget, Advanced page properties or add the code on  template/master page level.

    Best wishes,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
5 posts, 0 answered