+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Using jQuery in external pages stored within the Sitefinity project directory

Using jQuery in external pages stored within the Sitefinity project directory

5 posts, 1 answered
  1. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    23 Aug 2010
    Link to this post
    Hello telerik team! :)

    I have a certain project and there's this one basic feedback page that required extra coding to be done hence I created an external page, stored it within the root of the Sitefinity project directory and mapped it as an external page to  the website via the admin tool. The page needed a jQuery plugin to be added unto it for usability purposes.

    I saved the file of the jQuery plugin (.js) on the App_Themes folder under a sub-folder js and referenced it on my feedback page's code as necessary. I've set-up the necessary requirements for the plug-in to work and even tested it first on a non-Sitefinity project to see if my set-up works (it did). But then when I tried to run the feedback page it did not. Now I have two questions:

    1. How do I use the jQuery library within Sitefinity for this particular page? Do I reference it just like how I would in a regular website?
    2. How should jQuery plugins be added to a Sitefinity project? Is there a certain protocol for this?

    Thanks and more power.
  2. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    23 Aug 2010
    Link to this post
    Hi jkregala,

    You need to reference the Javascript file for the Sitefinity external page as you would do for any other website which does not use Sitefinity. You can either use a LINK in the header or the telerik:JsFileLink control to reference your JS files and everything should work as expected.

    Best,

    G
  3. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    23 Aug 2010
    Link to this post
    Thanks for the swift reply G. Do I include the jQuery library file among the references?
  4. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    23 Aug 2010
    Link to this post
    Hi jkregala,

    I am not sure what you mean by references but I recommend that you do it as follows:

    1- Create a folder under Files name it JS and put your jquery.js file there
    2- In your master page use this line in the header:

    <script type="text/javascript" src="/Files/js/jquery.js"></script>

    You're good to go,

    Best,

    G
    Answered
  5. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    23 Aug 2010
    Link to this post
    Thanks G! :)

    I think my problem was because I placed the js files on the wrong directory, my bad.
Register for webinar
5 posts, 1 answered