After you install plugin into your system, how can you build the ajax function?
1. Find the ajax plugin file (plugins/ajax/Your Ajax Plugin Name)
2. There are some key points when building an AJAX function in J4.
a. function name is onAjax{your plugin name}
b. After onAjax, the plugin name should start with an uppercase letter, and the rest should be lowercase.
c. The function name after onAjax should match your plugin name, not be randomly chosen.
d. You can check the plugin name in the system backend->system->plugin->find your plugin
How to call it?
1. It is very simple to call it, you can direct add an url after your domain like
domain/ajaxURL
Ajax URL format:
?option=com_ajax&plugin=plgrenewalsystemtemplatemessage&format=json
The format is fix, just change the plugin name to your plugin name
Completed ajax url
www.domain.com/?option=com_ajax&plugin=plgrenewalsystemtemplatemessage&format=json