There are a number of JavaScript libraries available that allow quicker development of JavaScript behavior for your website. We'll use the jQuery library, as this is one of the more popular JavaScript libraries.
Firstly, download jQuery from the jQuery website at http://docs.jquery.com/Downloading_jQuery.
1. Save the jQuery JavaScript file as
jquery.js
in thetemplates\rhuk_milkyway\js\
directory. You may need to create thejs
directory yourself. Now open your template'sindex.php
file and locate the<head>
element within the template:<head> <!-- omitted content --> <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/js/jquery.js"></script> </head>
That's it! Your Joomla! template now includes the jQuery library, meaning you can make use of it!