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 ...
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....
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. ...
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 ...
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 ...
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 ...
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);
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 ...
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 = "/...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
com-ajax × 10ajax × 5
joomla-3.x × 3
module × 3
joomla-4.x × 3
plugin × 2
mysql × 1
javascript × 1
database × 1
custom-field × 1
login × 1
form-fields-types × 1
authentication × 1
com-users × 1
login-module × 1