Ajax call to action 404 I've a trigger on my frontend that requires an action. I've started from the businessLogic template but I'm getting a 404 and can't find why.

My function

public function actionExampleAjax()
    {
      // Stuff
    }


How I call it

$.post('/actions/businessLogic/actionExampleAjax', data, function(response, textStatus, jqXHR) {
    // Stuff
});


The server response ( 404):

The system is unable to find the requested action "actionExampleAjax".


The action trigger is set to:

'actionTrigger' =&gt; 'actions'


The same approach works fine with a form submission, but I don't want to use a form in this case.

Any suggestion?
The URL you call using Ajax shouldn't include the action trigger, since Craft will add this to call the correct method in your controller when it interprets the URL.

So in the example you gave, your Ajax URL should be: /actions/businessLogic/exampleAjax

More details can be found in the Plugin Development docs.

Note that if you change the actionTrigger in the general.php config file, then you will need to change the first segment of the Ajax URL to match the new value for the actionTrigger.