In the above code, use the option = com_ajax, name of the module and it's format in raw|json|debug form.
Step 2 : helper file in joomla module (mod_mymodule) where we write the getdata method or function to post the ajax request.
Code Example:
public static function getdataAjax()
{
$id=JRequest::getVar('id');
//databse query
}
In the above code, write the getdata method or function as a getdataAjax() (beacuse all method's must end in Ajax if we use com_ajax as a option in Joomla).
0 Comment(s)