I am developing a module for Joomla 1.6 but I am running in to a problem which I believe is being caused by a cache problem.
I am adding javascript declarations as follows in the default.php file of the module
Code: Select all
$document =& JFactory::getDocument();
$document->addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');
$document->addScript('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js');
$document->addScript(JURI::root().'modules'.DS.'mod_portlets'.DS.'js'.DS.'jquery.cookie.js');
$document->addScript(JURI::root().'modules'.DS.'mod_portlets'.DS.'js'.DS.'portlets.js');
If I un-publish and re-publish the module then the JS files pop back into the head and the module works as it should, but again after a page or two they disappear again.
The only thing I could think of is that it is some sort of cache issue since the rest of the php for the module seems fine and the module is displaying, just without the JS elements.
Can anyone offer any solutions or reasons as to why this might happen?
Thanks