#108169Ajaxrouter for Backend not working
Description
Hi,
For a backend module I set up an Ajaxrouter in “Configuration/Backend/AjaxRouter.php”.
I also created a controller according to this dosumentation:
https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Backend/Ajax.html
use Mikelmade\Dahmsfunc\Controller\AjaxController;
return [
'dahmsfunc_ajax_upload' => [
'path' => '/dahmsfunc/ajaxupload',
'methods' => ['POST'],
'target' => AjaxController::class . '::uploadAction',
],
];
In a custom Javascript I am using I am trying to make the appropriate Ajax call (with jQuery):
$.ajax({
method: "POST",
url: "/typo3/dahmsfunc/ajaxupload",
data: { name: "John", location: "Boston" }
})
.done(function( msg ) {
alert( "Data Saved: " + msg );
});
The Ajax call is not working. The variable msg contains the whole HTML of the TYPO3 backend. If I try to call the path as it is defined the AjaxRouter I get a 404.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.