Adding JavaScript and jQuery

Posted by Community Admin on 03-Aug-2018 16:34

Adding JavaScript and jQuery

All Replies

Posted by Community Admin on 02-Mar-2015 00:00
I have been having issues trying to add JavaScript and jQuery to a page that I am trying to add tabs to. What I have done so far is added the script within the script widget by writing out the code and I have also had the scripts added so that I can plug in the URL for the script. Nothing seems to work, the tabs are there but when clicked it just takes me to the top of the page. What I need it to do is to change tabs and the info below the tab. I need all the help that I can get.
Posted by Community Admin on 05-Mar-2015 00:00
Hello Joe,

Can you please refer to the following documentation article for more details on how you can include javascript and jQuery resources in the markup of your user controls or pages.

It is also important to note that if you would like to load jQuery, we highly recommend that you use the built-in jQuery library which comes with Sitefinity (version 1.8.3). To do this, you can use the ResourceLinks control as shown below which will ensure that the built-in jQuery library is loaded on your page or page template:

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

If you would like to use a different version of jQuery, please refer to the following article on how to load different version of jQuery and to avoid conflicts which may occur between the different versions.

What I can also suggest is that you inspect the browser's console in order to check if there are any error messages logged there which will help you to find out what is the reason for the issue.

In addition to this you can try to test on a brand new page with no template or based on one of the built-in templates and add only your custom logic there and check if it will be working fine. This way you can isolate your custom code and check if it is not conflicting with any other scripts you load on this page.

Regards,
Sabrie Nedzhip
Telerik
 
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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 
Posted by Community Admin on 05-Mar-2015 00:00

@Joe Not sure how complex you need your tabs to be...but I have a drag\drop tab system lots of people use

www.sitefinitysteve.com/downloads

 

This thread is closed