title: How to send AJAX with dataType as script?
body: <p>im trying to create own POST request. Here is my function:</p>
  
  <pre><code>function sendPost(o) {
      var h = new XMLHttpRequest();
      h.onreadystatechange = requestComplete;
  
      function requestComplete() {
          if ( h.readyState === 4 ) {
              if ( h.status === 200 ) {
                  if ( o.done ) {
                      o.done(h.responseText);
                  }
              } else {
                  if ( o.fail ) {
                      o.fail(h.responseText);
                  }
              }
          }
      }
  
      h.open('POST', o.url, true);
      h.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
      h.send(o.data);
  }
  </code></pre>
  
  <p>Everything is OK, but im confused, how to set its dataType to <strong>script</strong>, like in jQuery:</p>
  
  <pre><code>$.ajax({
      url: 'someurl.php',
      type: 'POST',
      dataType: 'script' // &lt;-- how to do this?
  });
  </code></pre>