Skip to main content
4 votes

Adding ajax call in a module for Joomla 4

To use J4 style or custom naming conventions with AJAX you have to convert the module to new service-based format. At a minimum, service provider (services/provider.php) needs to provide a module ...
Sharky's user avatar
  • 12k
3 votes
Accepted

Change the helper.php path for com_ajax

You can't. The component looks for the helper like so: $helperFile = JPATH_BASE . '/modules/mod_' . $module . '/helper.php'; where $module is the name of your module. You will have to move the helper....
Lodder's user avatar
  • 26.9k
3 votes
Accepted

using Ajax to save contents of html how to make safe

On the SQL side, data inserted using JDatabaseDriver::insertObject() and JDatabaseDriver::updateObject() methods is escaped automatically. On HTML side, you should filter user input to prevent XSS. ...
Sharky's user avatar
  • 12k
2 votes
Accepted

Joomla plugin ajax request / class extend

Plugins call a single method based on the name of the plugin. But you can pass anything to the method including the name of another method you would like to run. Hence, running a call like the ...
jamesgarrett's user avatar
  • 3,339
2 votes
Accepted

com_ajax to plugin / or plugin field

Plugins don't use method parameter. Instead the value you currently have there should be used in plugin parameter. This is because com_ajax dispatches an event rather than calling a specific method of ...
Sharky's user avatar
  • 12k
2 votes

Adding ajax call in a module for Joomla 4

I had two extra minutes to test this according to my previous comments under your question. I created a helper.php inside the ArticlesLatest Module (root of that module) and created a class: class ...
Zollie's user avatar
  • 2,956
2 votes
Accepted

com_ajax call is hitting function but not returning result from other function call

The fatal error will be: "PHP Fatal error: Using $this when not in object context" You need to change return $this->getStores($zip); to return self::getStores($zip);
jamesgarrett's user avatar
  • 3,339
2 votes
Accepted

Joomla Ajax in Module from Administrator not work

Your AJAX URL is relative and ends up pointing to administrator/index.php. You can change that by prepending root path. First, load the required dependencies: JHtml::_('behavior.core'); Then change ...
Sharky's user avatar
  • 12k
2 votes
Accepted

Joomla login module Ajax Request

Now, if I wanted to give a lazy answer on this question I'd just write: you should target the correct URL with your AJAX call for getting the controller method and you are done: const url = "/...
Zollie's user avatar
  • 2,956
1 vote

Joomla plugin ajax request / class extend

To clarify, com_ajax does not call any method in your plugin. Instead, it triggers a regular event to which all loaded plugins can respond. So in theory the plugin query variable should be the name of ...
Sharky's user avatar
  • 12k
1 vote

Joomla Ajax in Module from Administrator not work

Thanks to those who cooperated on this issue. I had solved this by calling the public url (full url) of the module from the administrator, without letting JPATH_BASE fill in the location. For which ...
Leoalv's user avatar
  • 167
1 vote
Accepted

Use com_ajax with a custom field

com_ajax looks for a helper.php file in your root template directory and then searches for the method inside there, so you firstly need to create a helper.php with the following code: class ...
Lodder's user avatar
  • 26.9k

Only top scored, non community-wiki answers of a minimum length are eligible