This is my ajax query for calling a task in the controller (it works for Joomla 3 but doesn't work for Joomla 4):
$.ajax({
type: "POST",
url: "index.php?option=com_scrib&task=test&format=raw",
data: { 'forum_Id': forum_Id },
success:function(data)
{
var opts = $.parseJSON(data);
$.each(opts, function(i, d) {
$('#jform_category_id').append('<option value="' + d.id + '">' + d.name + '</option>');
});
}
});
The location of the controller file in Joomla 3: components/com_scrib/controller.php
Joomla 4 has a different file structure. I'm not sure if I'm doing it right.
In Joomla 4: components/com_scrib/src/Controller/DisplayController.php
What the correct url should be in Joomla 4?