Search code examples
javascriptjqueryjoomlajoomla2.5joomla-extensions

Insert Geocoding In Joomla Component Backend 2.5


I'm currently developing my first component for Joomla 2.5, Ive inserted jForm in the backend, I now need to add java script in the back-end, for i need to geo-code an inserted address and then fill in two fields one being latitude and the other longitude.

everytime i try to insert any form of script in the back-end i get a 500 error.

Any Help will be much appreciated.


Solution

  • as simple as:

    $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');
    

    Thanks anyway :)