How to add string to joomla header?

2019-08-14 04:32发布

问题:

I know that with JFactory::getDocument(); i can add some JS code to the header, but at the moment i need to add this kind of line <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]--> Is there some default methods?

回答1:

You can do this using Jdocument:

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


标签: joomla