如何将字符串添加到 joomla 标题?

编程入门 行业动态 更新时间:2024-10-28 00:27:50
本文介绍了如何将字符串添加到 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 标题?

本文发布于:2023-10-12 17:41:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485415.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   如何将   标题   joomla

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!