Adding jQuery to our module—refreshing data using JavaScript
Making our module look better is quite easy, as we are only using plain HTML for now. A bit of jQuery won't do any harm; in fact, it will look much better.
For this example, I've one jQuery plugin in mind: the Vertical news ticker plugin. We can find it on the jQuery site by searching for "Vertical news ticker", or we can download it at the following link:
http://plugins.jquery.com/project/vTicker.
Download the plugin, place the jquery.vticker.js
file
in modules/mod_tinynews/js/
, and we are done. We have the
necessary tool for our example. Our next step will be to change the
modules/mod_tinynews/tmpl/default_tmpl.php
file, just some cosmetic
changes, as follows:
<?php defined('_JEXEC') or die('Direct Access to this location is not allowed.'); ?> <div id="tinynews"> <ul> ...