title: How to properly setup a CORS POST request with Backbone.js
body: <p>I have an application where the backend is hosted on a different server than the front end. The backend is already set up to allow requests from the front end and we confirmed this with a POST request using the jQuery <code>$.ajax</code> method. Nonetheless, what I would really like to do is to configure the save method on a Backbone model to do the same or something similar such that it also works with Backbone. This is the code I have right now:</p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: 'https://someurl.com/controller',
      crossDomain: true,
      data: '{"some":"json"}',
      dataType: 'json',
      success: function(responseData) {
          // handle success
      },
      error: function (error) {
          // handle error
      }
  });
  </code></pre>
  
  <p>I would like to do something like this instead:</p>
  
  <pre><code>myModel.save(null, function(data){
      // handle response appropriately
  });
  </code></pre>
  
  <p>Could you help me?</p>