0

我目前正在为 Joomla 2.5 开发我的第一个组件,我在后端插入了 jForm,我现在需要在后端添加 java 脚本,因为我需要对插入的地址进行地理编码,然后填写两个字段纬度和另一个经度。

每次我尝试在后端插入任何形式的脚本时,都会收到 500 错误。

任何帮助都感激不尽。

4

1 回答 1

1

很简单:

$document = JFactory::getDocument();
$document->addScript("http://maps.google.com/maps/api/js?sensor=false");
$document->addScript("//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js");
$document->addScript(JURI::base() . 'media/mod_locate/js/mod_map.js');
$document->addStyleSheet(JURI::base() . 'media/mod_locate/css/mod_map.css');

不管怎么说,还是要谢谢你 :)

于 2012-11-23T08:17:35.350 回答