title: Cannot seem to set a Form's Encoding Type. (Javascript)
body: <p>I am trying to hardwire an on-the-fly created form to send JSON using the encoding type "<code>application/json</code>". </p>
  
  <p>in jQuery, I would set this as '<code>contentType</code>' in an <code>$.ajax</code> or a <code>$.post</code> - however for certain reasons, I need to be doing this manually.</p>
  
  <p>I have the following code, but it just doesn't work. It still defaults the enctype to <code>application/x-www-form-urlencoded</code></p>
  
  <pre><code>data = data;
  var form = document.createElement("FORM");
  form.style.display = "none";
  form.action = url;
  form.setAttribute('enctype', 'application/json');
  form.method = "post";
  </code></pre>
  
  <p>Am I trying to set the wrong property, or am I just setting it wrong? Any ideas?</p>