2014-04-07 57 views

回答

1

要添加CSS和JS文件的Joomla 3.x中,你應該使用JHtml,就像這樣:

JHtml::_('script', 'http://some-external-site.com/file.js'); 
JHtml::_('stylesheet', 'http://some-external-site.com/file.css'); 

如果它們是同一臺服務器組件,並在media/com_myComponent上,然後使用以下命令:

JHtml::_('script', com_myComponent/js/file.js', false, true); 
JHtml::_('stylesheet', 'com_myComponent/css/file.css', false, true); 

希望這有助於

+0

感謝答覆。工作正常 –

相關問題