I have no experience with Ajax and little to no experience with Joomla. I've managed to create my own Joomla modules with no problem. Today I tried to use Ajax in one of my modules but I am getting an error: "Method getAjax does not exist.".

Here is my helper.php


class ModDisplayVacancies
    public static function getAjax()
       return "getAjax return";


my mod_display_vacancies.php


// No direct access
defined('_JEXEC') or die;
// Include the syndicate functions only once

$document = JFactory::getDocument();
require_once dirname(__FILE__) . '/helper.php';


$table = ModDisplayVacancies::createTable($params);

require JModuleHelper::getLayoutPath('mod_display_vacancies');

And my JavaScript:

jQuery(document).on('click', 'button[id=vacancies_next]', function(){


    var request = {
        'option' : 'com_ajax',
        'module' : 'display_vacancies',
        'data' : 5,
        'format': 'json'

        type: 'GET',
        data: request,


It's pretty strange to me why in the console I'm getting "success" and then an error:

console screenshot

  • Your issues may be due to naming conventions - what happens if you rename your helper Class to modDisplayVacanciesHelper or modDisplay_VacanciesHelper?
    – FFrewin
    Oct 9, 2017 at 14:45

1 Answer 1


Your Helper Class name should be:


And the Module must be published on all pages, if not you have to add one menu ID in your request where the module is published. Just like this:

&Itemid=<menu id>
  • I've changed the name of my helper class to ModDisplayVacanciesHelper and it resolved my problem. But the module is published only on one single page inside my hidden menu ( I have two menus one of which is hidden one). Thanks for your help !
    – VTodorov
    Oct 10, 2017 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.