Kin
Kin

Reputation: 4596

How to add string to joomla header?

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?

Upvotes: 1

Views: 209

Answers (1)

patterncatcher
patterncatcher

Reputation: 275

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);

Upvotes: 3

Related Questions