custom master page... how do I reference jquery and prototype?
Hello,
I'm creating my own custom master page and I wish to add jQuery support...how can I achieve this?
Thanks
Paolo
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
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?
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.
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