title: Ajax Setup, base url
body: <p>I have a lot of ajax calls in my project, so I configured my ajaxsetup to handle the errors by default and some other configs:</p>
  
  <pre><code>$.ajaxSetup({  error: function(result){ ....}});
  </code></pre>
  
  <p>Now all my ajax calls have an url, something like this:</p>
  
  <pre><code>$.ajax({
              url: 'http://localhost/controller/action',
              type: 'GET'           
          });
  </code></pre>
  
  <p>All these urls share this of course <em>http://localhost</em>, so my question is if I can configure the <em>ajaxsetup</em> so the base url is set by default and I just have to put the dynamic part of it in each call, so calls should look like this</p>
  
  <pre><code>$.ajax({
              url: '/controller/action',
              type: 'GET'           
          });
  </code></pre>
  
  <p>This would help when moving from dev to test or live as well</p>