3 Replies Latest reply on Jun 25, 2019 11:35 AM by jgoldhammer

    Add custom JS script to HTML file

    craigoryb

      I'm trying to add a "simple" photo slideshow to our homepage using CSS and jQuery, but am finding it extraordinarily difficult to:

      1) Get the jQuery to actually work without showing a "$ is not defined" error,

      2) Get the jQuery to actually run in the first place,

      3) Debug the jQuery using the Developer Tools in any browser

       

      Is it possible to add a jQuery function to an HTML file in the first place? And if so, how do I get it to run correctly?

        • Re: Add custom JS script to HTML file
          itsallbroken

          When you say HTML File, what do you mean exactly? Are you creating a custom theme map and modifing the SOY/FTL files or are you using an Overview page with the HTML widget or are you using Tiles?

           

          JQuery is build into Jive so you can call using $j rather than just $, tis may solve your problem, if your using widgets/tiles though then you need to make sure that jQuery is being called correctly.

           

          As for debugging, i use Chrome and its built in developer tools and that works perfectly for me.

           

          If the above doesn't help please clarify exactly what steps your are doing

           

          Thanks

            • Re: Add custom JS script to HTML file
              kautuksahni

              Gareth Cole Due to some minor requirements, we made some edits (added a JS file) in the Admin console -> Settings -> Themes -> edit the Adobe global theme -> Custom-Css.soy.

              But, I am unable to see it getting reflected (Js file is not coming to the forums). Do we have to do some kind of publishing or Clearing the cache of the Forums to get changes reflected on the forums?

               

              Also, is there a better way to add custom JS file to the forums than using “Admin console -> Settings -> Themes -> edit the Adobe global theme -> Custom-Css.soy” [Found this solution in JIVE Forums]?

              Also, Is there a way to Add JS only to Sub-Space/community than adding to global Space?

               

              -Kautuk