Craft CMS plugin with AJAX gives 404 error I have created a small craft cms plugin to pull some information from the DB, and everytime I execute the plugin I get a 404.   

Here is the controller

namespace Craft;

class UserExists_UserControllerController extends BaseController
{
    public function actionGetUser()
    {
        $this-&gt;returnJson($response);
    }
}


And this is the jquery:

$.ajax({
    url: "{{ url("actions/userexists/usercontroller/getUser") }}",
    dataType: "json",
    success: function(data){
        console.log(data)
    }
});
If you aren't currently logged in, you're apt to be running up against the "anonymous access" limitation.

This section of the Controller documentation should help:


  By default, controller actions are only accessible to logged-in users. You can override that by changing the protected $allowAnonymous property on your controller class. To allow anonymous access to all of your controller’s actions, set it to true:


&lt;?php
namespace Craft;

class CocktailRecipes_IngredientsController extends BaseController
{
  protected $allowAnonymous = true;

  // Your action methods
}