Search code examples
joomlacustom-code

How can I add custom code to the header


How can I add the following line to the header, in a component?

<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->

Solution

  • Not sure if it will work with any text, but you could try:

    $document =& JFactory::getDocument();
    $document->addCustomTag('<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->');
    

    I hope it will be helpfull.