Craft CMS plugin with AJAX gives 404 error
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
}