问题
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);
来源:https://stackoverflow.com/questions/13909622/how-to-add-string-to-joomla-header