title: html5 Canvas signature pad error with xmlhttpRequest
body: <p>I am following this post:<a href="https://stackoverflow.com/questions/17015935/cant-get-html5-canvas-signature-pad-to-submit-to-database">Can't get html5 Canvas signature pad to submit to database</a>, and is a great signature script, but I already have a error when I tried to save it into DB...the console give me this error:</p>
  
  <pre><code>Error: Failed to construct 'XMLHttpRequest': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
  </code></pre>
  
  <p>Can you help me with this part of javascript to fix it:</p>
  
  <pre><code>$("#saveSig").click(function saveSig() {
      //encode URI
      var sigData = encodeURIComponent(canvas.toDataURL("image/png"));
      $("#imgData").html('Thank you! Your signature was saved');
      var ajax = XMLHttpRequest();
      ajax.open("POST", 'sign/signature.php');
      ajax.setRequestHeader('Content-Type', 'application/upload');
      ajax.send(sigData);
      $('#debug').html(sigData);
  });
  </code></pre>