title: How to include a JavaScript file in CakePHP 2.0
body: <p>I am trying to include a .js file I created by using this:</p>
  
  <pre><code>echo $this-&gt;Html-&gt;script('vote');
  </code></pre>
  
  <p>My file is in /js/vote.js</p>
  
  <p>I load the website and I go to the sourcecode, I click on the .js script file to see what it is loading and what I find out is that that the is an error loading vote.js</p>
  
  <p>When I try to access directly from the URL using:</p>
  
  <p><a href="http://localhost:8888/mysite/js/vote.js" rel="nofollow">http://localhost:8888/mysite/js/vote.js</a></p>
  
  <p>I find this:</p>
  
  <hr>
  
  <pre><code>Error: JsController could not be found.
  Error: Create the class JsController below in file: app/Controller/JsController.php
  
  &lt;?php
  
  class JsController extends AppController {
  
  }
  </code></pre>
  
  <hr>
  
  <p>Then I created what it says, I get another error:</p>
  
  <hr>
  
  <pre><code>Missing Method in JsController
  
  Error: The action vote.js is not defined in controller JsController
  
  Error: Create JsController::vote.js() in file: app/Controller/JsController.php.
  
  &lt;?php
  
  class JsController extends AppController {
  
      public function vote.js() {
  
      }
  
  }
  </code></pre>
  
  <hr>
  
  <p>What's the problem?  Why is it so complicate to load a .JS file?</p>
  
  <p>I am just trying to make a button to vote on articles and I am driven crazy...</p>