2011-08-05 17 views

答えて

7

それは、任意のテキストで動作しますが、あなたが試みることができるかどうかわからない:

$document =& JFactory::getDocument(); 
$document->addCustomTag('<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->'); 

を、私はそれが参考になっことを願っています。

+0

あなたのソリューションは実際には動作しますhttp://docs.joomla.org/JDocumentHTML/addCustomTag addCustomTagを使用できるかどうかはわかりませんでした。いいね :) –

1

あなたは使用することができます:私は条件文を追加する方法を探しています

<?php 
    $document = &JFactory::getDocument(); 
    $document->addScript('/js/excanvas.min.js'); 
?> 

...

UPDATE

を確認するユーザエージェントがIEの場合

<?php 
    $document = &JFactory::getDocument(); 

    //Is it Internet Explorer? 
    ereg('MSIE ([0-9]\.[0-9])',$_SERVER['HTTP_USER_AGENT'],$reg); 

    if(isset($reg[1])) { 
     //Yes, it is Internet Explorer 
     $document->addScript('/js/excanvas.min.js'); 
    } 
?> 
関連する問題