Try Now
More in this section

Forums / Developing with Sitefinity / Best way to incorporate JavaScript into Sitefinity

Best way to incorporate JavaScript into Sitefinity

2 posts, 0 answered
  1. Jeffrey
    Jeffrey avatar
    17 posts
    11 Nov 2010
    22 Dec 2010
    Link to this post

    I'm developing a site that has a simple jQuery rotating graphic on each page. I cannot seem to find a clear answer on how to do this, however. I came across Georgi Chokov's post about jQuery libraries (http://www.sitefinity.com/blogs/georgichokov/posts/09-03-25/how_to_use_jquery_and_other_javascript_libraries_in_sitefinity.aspx) but like MrX at the end, I do not understand where I am to be referencing my external script and where I should be storing the script within Sitefinity's hierarchy of folders.

    JavaScript is a pretty universal language that's used on many if not most websites these days. It seems silly that Sitefinity doesn't incorporate scripting languages into the CMS more easily. And, hopefully, I've missed something.

    Any direction or help is appreciated in advance.

    Thank you,

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    25 Oct 2016
    24 Dec 2010
    Link to this post
    Hello Jeffrey,

    You can use one of the embedded scripts loaded by JsFileLink when you set ScriptType enum

    There are 4 options that you can set

    • jQuery
    • prototype
    • mooTools
    • Custom
    When you set Custom you should set FileName property. This property accepts a string which represents the virtual path to your custom js file. There is no specific requirement where to put this file, so you can create a new folder in you root called "MyScripts" and put your js files there. There make a reference to these files by using JsFileLink control.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered