如何将字符串添加到 joomla 标题? [英] How to add string to joomla header?

查看:16
本文介绍了如何将字符串添加到 joomla 标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道使用 JFactory::getDocument(); 我可以在标题中添加一些 JS 代码,但目前我需要添加这种行 <!--[如果是 IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]--> 有没有一些默认的方法?

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?

推荐答案

您可以使用 Jdocument 做到这一点:

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 标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆