title: jQuery ajax not work
body: <p>This is my function to call ajax:</p>
  
  <pre><code>var sendAjax = function(type, data, callback) {
    $.ajax({
      url: homepage + 'server_ajax.php',
      type: 'POST',
      data: {
        type: type,
        data: JSON.stringify(data)
      }
    }).done(function(data) {
      console.log(data);
      callback(true, JSON.parse(data));
    }).fail(function() {
      console.log('NO');
      callback(false, {});
    });
  };
  </code></pre>
  
  <ol>
  <li><p>Variable <code>homepage</code> contains valid URL. It is same domain, so this is not the problem.</p></li>
  <li><p>My <code>server_ajax.php</code> has only this: <code>echo "awdawda wawddawawd";</code> - nothing more (testing purposes).</p></li>
  <li><p>I tried to put breakpoints to <code>$.ajax...</code> and to the console logs. First breakpoint works, but functions <code>done</code> and <code>fail</code> never run.</p></li>
  <li><p>No error show up in the browser console</p></li>
  <li><p>My jQuery is include (I'm sure), I use <code>require.js</code> and everything else in this JS file using jQuery works well.</p></li>
  <li><p>I also tried change URL to something invalid (like <code>server_ajax2.php</code>) and console prints error 404 - like it would.</p></li>
  <li><p>Also tried with <code>dataType: 'json'</code> or removing <code>data</code> object...</p></li>
  </ol>
  
  <p>Any ideas, what should I try? I also tried some answers on this site (don'r flag this as duplicate, I tried like everything), but nothing helped me.</p>