0
Welcome Guest! Login
0 items Join Now

ROCKETTHEME IS CLOSING ON JUNE 30, 2025. As a thank-you to our community, enjoy 50% off all themes with the promo code THANKYOU before we shut down. Read our Farewell Blog Post for more details.

Adding a javascript to J2.5 the right way

  • Adding a javascript to J2.5 the right way

    Posted 13 years 3 months ago
    • Ive had a good look around but can't find anything on these forums for J2.5?

      1. Where do I put the JS file?
      2. How do I get Gantry to load them?

      Many many thanks for helping,

      Garry
    • Henning's Avatar
    • Henning
    • Preeminent Rocketeer
    • Posts: 29363
    • Thanks: 957
    • Volunteer

    Re: Adding a javascript to J2.5 the right way

    Posted 13 years 3 months ago
    • 1. put it in js folder of the template
      2. add this to the head tag of the index.php of the template
      <?php $gantry->addScript('yourscript.js'); ?>
  • Re: Adding a javascript to J2.5 the right way

    Posted 13 years 3 months ago
    • Thank you so much!
      I was thinking it had to go in the Gantry js folder, but now i see the logic!
      Thanks once again, awesome help

Time to create page: 0.068 seconds