Joomla 3.x: How to add or Link to a external javascript file

1.6k views Asked by At

I want to use a parallax for my Joomla.

Specifically this one: https://github.com/IanLunn/jQuery-Parallax

How can I insert these to my joomla pages.

<script type="text/javascript" src="scripts/jquery.parallax-1.1.3.js"></script>
<script type="text/javascript" src="scripts/jquery.localscroll-1.2.7-min.js"></script>
<script type="text/javascript" src="scripts/jquery.scrollTo-1.4.2-min.js"></script>

I am using this template with Helix Framework

http://demo.joomshaper.com/?template=radon#

2

There are 2 answers

0
Oliver On BEST ANSWER

The proper way to add Java-Script Libraries in to your Joomla Installation (Template or Components) is explained in Joomla Docs:

<?php
  $document = JFactory::getDocument();
  $document->addScript('/media/system/js/sample.js');
?>

Reference: Adding JavaScript

0
mokiSRB On

If u have access to files, ftp or cpanel, Go to template files, find heder secton and place the code. Try at this path

temlates/your_template/index.php