Include Craft JS object
The Craft global variable is available to any Javascript running in the backend/Control Panel, without including anything.

It's not possible to include, reference or use the global for any code running in the frontend.



EDIT:

To provide access to a controller action for frontend Javascript, I'd recommend setting up a site route in your plugin's main class. The following will route the URL http://yourbaseurl/myplugin/foobar/add to ExampleController:

public function registerSiteRoutes()
{
    return array(
        'myplugin/foobar/add' =&gt; array('action' =&gt; 'myPlugin/example/add'),
    );
}


As for the ExampleController, be sure to set the $allowAnonymous class variable to true. This allows visitors that aren't logged in to Craft access (beware that this will make all your controller´s actions accessible without login):

class MyPlugin_ExampleController extends BaseController
{
   protected $allowAnonymous = true;
   public function actionAdd()
   {
       // Your code here           
   }
}