More in this section
Forums / General Discussions / Trouble including JQuery

Trouble including JQuery

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
64 posts, 0 answered
  1. David
    David avatar
    114 posts
    19 Jul 2012
    02 May 2015 in reply to Radoslav Georgiev
    Link to this post

    Hi Radoslav,

    I get the following error when running the project when I add in assemblyinfo="SitefinityWebApp" in the Resource File statement.  Any help appreciated.

    Server Error in '/' Application.

    Type "SitefinityWebApp" cannot be resolved.​

  2. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    31 May 2017
    08 May 2015
    Link to this post

    Solution has been provided by a customer in this forum thread:

    Stefani Tacheva
    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
  3. Coty
    Coty avatar
    0 posts
    05 Jun 2014
    17 Sep 2016
    Link to this post

    So is this still an issue in Sept. 2016. Sitefinity Version 8.2.5900.0?  It's over 4 years later...

    <sf:ResourceLinks ID="ResourceLinks" runat="server">
        <sf:ResourceFile JavaScriptLibrary="JQuery"></sf:ResourceFile>
    <sf:JavaScriptEmbedControl runat="server" ID="directionsJS" ScriptEmbedPosition="Head" Url="~/scripts/imagerotator.js"></sf:JavaScriptEmbedControl>

    imagerotator.js depends on jquery.

    I get this error: 

    Uncaught ReferenceError: $ is not defined

    Is there a better way to do this now?

    Jquery is so prominent there literally should be a checkbox in the Sitefinity GUI that says: Load Jquery, and it loads it first....

    Can I add Jquery in the GUI via the Widgets > Javas Script on my Master Page Template?  I just want it to load for the entire site one time - first.  Should be simple.

    Another Attempt:

    originally the imagerotator.js code was embedded into a script tag directly in the ascx file.  I wanted to externalize it and get it minified.  The javascriptembedcontrol fixed this.  However it created the loading order issue with jquery even though jquery is placed first in the HTML.  I just tried to add the imagerotator.js as a widget on my home page template and choose the selection to include it just before the body tag closing.  This would work for me in my case because this particular template is ONLY used by my home page.  It did work in getting rid of the undefined error.  However, the script is now not minimized so it defeats the purpose.  Might as well just paste the code in again.

    27th Attempt:

    1. I set my JS file as an embedded resource.

    2. added to AssemblyInfo.cs

    [assembly: WebResource("SitefinityWebApp.CAIU.Widgets.scripts.imagerotator.js", "application/x-javascript")]

    3. Updates the ResourceLinks Code

    <sf:ResourceLinks ID="ResourceLinks" runat="server" UseEmbeddedThemes="true">
    <sf:ResourceFile JavaScriptLibrary="JQuery"></sf:ResourceFile>
        <sf:ResourceFile Name="SitefinityWebApp.CAIU.widgets.scripts.imagerotator.js" AssemblyInfo="SitefinityWebApp.CAIU.Widgets.ImageRotator, SitefinityWebApp"/>

    4. Rebuild Application

    5. Run - still doesn't work and it can't find the file.  

    Anything I'm doing wrong?

    The worst part is I do all this in a dev environment and then have to publish it all to a load balanced site that uses 3 instances.  this whole thing is pretty frustrating and probably not worth the effort at this point.


  4. Coty
    Coty avatar
    0 posts
    05 Jun 2014
    18 Sep 2016 in reply to Coty
    Link to this post

    I got the ResourceLinks working - I'm not quite positive what went wrong yesterday.  I verified I had the correct name with the following code:

    var stringArray = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();

    And I had the name correct.  Then it just started working, so I don't know if my build didn't take yesterday or something was cached still on the page.

64 posts, 0 answered
1 2 3