title: How to fix cross-origin request fail in Firefox
body: <p>I have a javascript file in which i want to send json data to a ERP system:</p>
  <pre><code> var formData1 = JSON.stringify($('#msform').serializeObject());
      $.ajax({
          url:'http://102.101.101.11:80/c/orders',
          type:'POST',
          data:formData1,
          crossDomain: true,
          dataType: 'json',
          jsonpCallback: 'callback',
          success: function(data) {
              //window.location.href = &quot;http://www.petlooza.com&quot;;
              console.log(data);
          }
      });
  </code></pre>
  <p>This script works with chrome and IE, <strong>but FIREFOX gives me this error:</strong></p>
  <blockquote>
  <p>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at the url. Reason: Cors-request failed.</p>
  </blockquote>
  <p>How to fix this? <strong>See solution below!</strong></p>