How to Add javascript in Joomla
There are three ways to add javascript Inline JavaScript 1: <?php 2: $document = JFactory::getDocument(); 3: $document->addScriptDeclaration(‘ 4: window.event(“domready”, function() { 5: alert(“An inline JavaScript Declaration”); 6: }); 7: ‘); 8: ?> External JavaScript There are two ways to include a JavaScript file 1: <?php 2: $document = JFactory::getDocument(); 3: $document->addScript(‘/media/system/js/sample.js’); 4: ?> The second […]