How Can We Help?
JavaScript code can directly be declared within a component or module’s display view
<?php
$document = &JFactory::getDocument();
$document->addScriptDeclaration('
alert("An inline JavaScript Declaration");
');
?>
For more information visit: http://docs.joomla.org/Adding_JavaScript
<?php $document = &JFactory::getDocument(); $document->addScriptDeclaration(' window.event("domready", function() { alert("An inline JavaScript Declaration"); }); '); ?>