How to add string to joomla header?

2019-08-14 04:23发布

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?

标签: joomla
1条回答
走好不送
2楼-- · 2019-08-14 05:24

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);
查看更多
登录 后发表回答