title: Fat-Free Framework + JQuery AJAX GET = no response
body: <p>I have a mapped Fat-Free Framework class declared as follows in my <code>index.php</code>:</p>
  
  <pre><code>$f3-&gt;map('/user', 'User');
  </code></pre>
  
  <p>The <code>User</code> class looks like this:</p>
  
  <pre><code>&lt;?php
  class User {
    function __construct($f3) {
      $this-&gt;users = new \DB\SQL\Mapper($f3-&gt;db, 'users');
    }
  
    function get($f3) {
      return json_encode('Just some text');
    }
  
    function post($f3) {
      // There is tested, working code in here but I've omitted it for simplicity's sake
    }
  
    function put($f3) {
    }
  
    function delete() {
    }
  }
  </code></pre>
  
  <p>I have my Javascript first loaded by app.js like this:</p>
  
  <pre><code>$(document).ready(function(){
    var currentPage = $(location).attr('pathname'),
        requiredJS = document.createElement('script'),
    requiredJS.type = 'text/javascript';
  
    switch(currentPage) {
      case '/mypage':
        requiredJS.src = 'myscript.js';
        $('body').append(requiredJS);
        break;
      // more cases...
    }
  });
  </code></pre>
  
  <p>Then my simple AJAX call in <code>mypage.js</code> looks like this:</p>
  
  <pre><code>$.get('/user', function (data) {
    console.log(data);
  });
  </code></pre>
  
  <p>When I go to the <code>/mypage</code> route, I get only an empty string in my console.  Why is this happening?  Where am I messing up?</p>